cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing UTC Date/Time Values

Former Member
0 Kudos

What java class/method does the TransformDate function use?

I'm trying to parse the following UTC formated date string with the TransformDate function.

<b><DateTime DateTimeQualifier="On">2007-11-02T20:17:28Z</DateTime></b>

According to the API Docs for <a href="http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html">Java Simple Date Format</a> says that the input mask should look like this:

yyyy-MM-ddTHH:mm:ssZ

Integration builder chokes on the "T" literal character. Wrapping the T in single (or double) quotes doesn't get it done either.

How have you solved transformed date strings like this?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

The solution wasn't optimal, but I used the "replaceString" function to strip out the characters that didn't fit the Simple Date Format mask.

Once I stripped out the "T" and "Z" characters, we could parse the date.

Former Member
0 Kudos

Hey

AFAIK the DateTrans function might not be able to comprehend <b>2007-11-02T20:17:28Z</b> coz of "T",a way around can be to write a simple UDF which will take <i>2007-11-02T20:17:28Z</i>(<DateTime>) as a input,then use substring function to chop off segments of it and then you can concat them in whatever format you want.just make sure that the source and target field must be xsd:string.

if you can do it with just DateTrans function then let us know

Thanx

Aamir

Former Member
0 Kudos

Our time zone is GMT -06:00. Once you chop the "Z" from the string the date/time string your date effectively becomes "local" time.

If the time component was important to this integration scenario, we'd would need to take steps to preserve the time accurately. I think we'd have to replace the "Z" with "-06:00"

Thanks for the help!