Ircorrect when using "parse date" in preaparation

Highlighted
tmgiang
Level 1
Ircorrect when using "parse date" in preaparation
Jump to solution

When I use formula in preparation, i choose the Time Zone to Asia / Jakarta and expect the original time (in UTC) will change to GMT +7, but seem DSS do incorrecly:



Original Date: 2018-01-22T12:02:55.891Z



Expected Date: 2018-01-22T19:02:55.891Z



DSS Converted Date: 2018-01-22T05:02:55.891Z



What wrong I did?



 



0 Kudos
1 Solution

Accepted Solutions
Clément_Stenac Dataiker
Dataiker
Re: Ircorrect when using "parse date" in preaparation
Jump to solution
Hi,

Actually your input date is already parsed and does not need parsing (see that it already has meaning "Date").

By removing the timezone from the pattern (because you put it as a constant), and selecting Asia/Jakarta in the parse step, you're actually telling it "ignore the timezone already specified in the date, and consider that the untimezoned thing that you just read is in Jakarta".

Then, DSS always currently displays the parsed date in UTC. So you parsed "noon in Jakarta", which indeed corresponds to "5 AM UTC", which is what DSS shows.

If you want to do the opposite, ie display this UTC date in the Jakarta local time, you need to use a "Format date" step instead of parse date, and select Asia/Jakarta as the time zone there

View solution in original post

2 Replies
Clément_Stenac Dataiker
Dataiker
Re: Ircorrect when using "parse date" in preaparation
Jump to solution
Hi,

Actually your input date is already parsed and does not need parsing (see that it already has meaning "Date").

By removing the timezone from the pattern (because you put it as a constant), and selecting Asia/Jakarta in the parse step, you're actually telling it "ignore the timezone already specified in the date, and consider that the untimezoned thing that you just read is in Jakarta".

Then, DSS always currently displays the parsed date in UTC. So you parsed "noon in Jakarta", which indeed corresponds to "5 AM UTC", which is what DSS shows.

If you want to do the opposite, ie display this UTC date in the Jakarta local time, you need to use a "Format date" step instead of parse date, and select Asia/Jakarta as the time zone there

View solution in original post

tmgiang
Level 1
Re: Ircorrect when using "parse date" in preaparation
Jump to solution
thanks you. it works
0 Kudos
Labels (2)