cancel
Showing results for 
Search instead for 
Did you mean: 

Strange timestamp-format in Dynamic Configuration

Former Member
0 Kudos

Hi all,

In the Dynamic Configuration Section I can retrieve the name and timestamp of the inputfile I use. But the timestamp is in a format I don't quite understand.

For instance, the last changedate of the inputfile is 24-06-2008, 10:58. In the Dynamic Configuration section I find the timestamp "20080624T035800Z". There seems to be a difference of 5 hours here, and I have no idea what the "Z" on the last position means.

How can I convert this timestamp from the Dyn.Conf. to the actual timestamp?

Thanks,

William

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI,

Just try the below lines of code

Date dt = new Date("01-Jan-2005");

BigDecimal bd = new BigDecimal(dt.getTime());

Probably this could be usefull for you:

thanks

swarup

Former Member
0 Kudos

Thanks Swarup.

If I understand correctly your code is to convert a specific date into big decimal.

I need to convert the other way around though... so from yyyymmddThhmmssZ to dd-mm-yyyy hh:mm:ss

Is there a java-function that converts this long date into a "normal" dateformat, taking the timezone into consideration?

William

GabrielSagaya
Active Contributor
0 Kudos

You can use subString to get the desired output.

There is no such Java Function available for you.

even TimeStamp differs your output

function myudf(String a, Container container)

{

//input is yyyymmddThhmmssZ

String year=a.subString(0,4);

String mon=a.subString(4,2);

String date=a.subString(6,2);

String hour=a.subString(9,2);

String min=a.subString(11,2);

String sec=a.subString(13,2);

// output is dd-mm-yyyy hh:mm:ss

String ret=date"-"mon"-"year" "hour":"min":"+sec;

return ret;

}

Answers (1)

Answers (1)

Former Member
0 Kudos

I think the time is different due to change in geographical areas. Check that.

'Z' may be the end delimeter.