on 04-24-2013 11:10 PM
Hi Gurus/Experts
The date format for DATUM is 20130424--- And I want to Split it. Please see the E.g Below
Date coming in like this "20130424" which should be "2013-04-24T15:36:28 -05:00" 15:36:28 is the time and -05:00 is constant.
I tried all, but this can only be done in UDF, I tried the threads and codes but nothing worked, Please suggest a code for this UDF.
This is the code I'm trying-
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("DATUM")
String SourceFileName = "C1." + a + ".C2";
conf.put(key, SourceFileName);
return " ";
Thanks in Advance!
Hi Vaibhav,
You can simply achieve your requirement using dateTrans inbuild fn .No need to any udf
select Input date format as yyyyMMdd and o/p date format as yyyy-MM-dd .Do the same for time as well if you require.
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI your input value contains only date, but in your output you want the time also, what time do u want to keep either current system time or any constant time value you want to keep.
clarify your requirement
regards,
Manigandan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You can try with simple date format class. Here is an example which I used some time ago:
DateFormat dateFormat = new SimpleDateFormat(""yyyy-MM-dd'T'HH:mm:ss.SSSZ"");
newFilename = oldFilename+"_"+dateFormat;
conf.put(key, newFilename);
In this one I had added the time stamp in the above format to the file name. You can modify it as per your requirement. Refer to the below link:
http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.