cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

Get offset from a date

vipulk10
New Contributor III

hi all,
i have been trying to get offset in a date format. i m using

toLocaleDateTimeString({โ€œtimeZoneโ€:$dealerTimeZone, โ€œformatโ€:โ€œyyyy-MM-dd'T'HH:mm:ss Zโ€})

since Z denotes offset, but its not showing offset in output ie -0800 or something like this.Please help

5 REPLIES 5

mthirani
Employee
Employee

Z specifies the UTC or Zulu Time Zone (Zero hour offset). It will not be showing output like -0800 as mentioned.

vipulk10
New Contributor III

so is there any workaround to get this??

the Z indicates there is no time offset from GMT. Where do you want an offset from?

del
Contributor III

I think vipulk10 is using the Z per the joda DateTimeFormat per the URL referenced in the SnapLogic Documentation for toLocaleDateTimeString - DateTimeFormat (Joda-Time 2.11.1 API). If the SnapLogic method utilized the joda formatting entirely, the Z would result in the offset value โ€œ-0800โ€. While โ€˜Zโ€™ (in single quotes) would result in the string โ€œZโ€ to represent GMT if desired.