on 01-23-2012 6:13 AM
Hi,
i need a udf for the following requirement
"Source will be Format: 'CCYY-MM-DD-HH.MN.SS.TTTTTTu2019
Example: u20182011-04-18-14.32.13.494000u2019
Destination will be
Fomat: 'YYYY-MM-DDThh:mm:ssZ'
Example: '2002-05-30T09:30:10Z'
Note: The source date will be in the CST timezone and must be converted to the GMT timezone"
thanks in advance
HI praneethrao13 ,
you try to use below code and before change the code as ur requirement.
example for UTS to CST:
====
imports: java.util.Date;java.text.SimpleDateFormat;java.text.DateFormat;
====
Date date = new Date();
DateFormat utcFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSS");
DateFormat cstFormat = new SimpleDateFormat("yyyy-MM-dd-HH.mm.ss.SSSS");
TimeZone utcTime = TimeZone.getTimeZone("UTC");
TimeZone cstTime = TimeZone.getTimeZone("CST");
utcFormat.setTimeZone(cstTime);
cstFormat.setTimeZone(utcTime);
return utcFormat.format(date);
thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
simple google it.. you wil get sample java codes and use it as a UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.