Get offset from a date

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

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

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?

I think vipulk10 is using the Z per the joda DateTimeFormat per the URL referenced in the SnapLogic Documentation for toLocaleDateTimeString - http://www.joda.org/joda-time/apidocs/org/joda/time/format/DateTimeFormat.html. 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.

1 Like

del you are correct, but i am not getting the desired response . currently I am using

toLocaleDateTimeString({“timeZone”:$dealerTimeZone, “format”:“yyyy-MM-dd’T’HH:mm:ss Z”})

Z is not parsed correctly and offset is not shown in the output