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.