on 02-24-2016 7:09 AM
Hi All,
I am getting an date time format as yyyy-MM-dd'T'HH:MM:SS for one of the input field.
I need to pass the this input to two output fields i..e, Date as 'yyyyMMdd' and Time as 'HHMMSS'
but the problem in the input datetime is coming as ex:- 2016-02-24T::
where hours,min,seconds are missing when this is missing we need pass default as 000000 ,in this case i need to pass date as 20160224 and time as default 000000
we tried using a DateTrans function and UDF as well but getting an error.
String outVal[]= new String[2];
String outDateTime=inDateTime.replace(":","");
outDateTime=inDateTime.replace("-","");
outVal=outDateTime.split("T");
return outVal[iIndex]; for date index is 0 and for time index is 1
Please help with sample code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
i guess you can do this with out UDF,
if you get date as 2016-02-24T10:30:00
the length of the above format is 19 so if the length is less than 19 then use substring function to get only date(2016-02-24T) and paa to the target date field and other target field you can pass default value(000000)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.