Ircorrect when using "parse date" in preaparation

Solved!
tmgiang
Level 2
Ircorrect when using "parse date" in preaparation

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
Clรฉment_Stenac
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
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
tmgiang
Level 2
Author
thanks you. it works
0 Kudos

Labels

?
Labels (2)
A banner prompting to get Dataiku