the timezone is kept. However, in Zapier, when I do the same thing, it strips the timezone information and shows “2021-10-25T15:06:08.000Z”. I need to know the hours in the original timezone. I’ve checked the profile settings and zap settings, and both are set to Los Angeles.
Page 1 / 1
Hi @djung
Try treating the timestamp as a string instead of as a Date.
@Troy Tessalone So you mean extracting the hour myself? That’s an alternative for sure. I was wondering if someone knew of this issue on Zapier’s end too though and whether it’s intended to be fixed.
But the timezone is in the timestamp string. I’m wondering why Zapier’s javascript doesn’t behave the same way as javascript in a web browser, which would see the timezone and retain that information when calling `new Date()` on the timestamp.
I don’t think Moment.js can be used in Zapier, can it?
@djung
Based on your screenshots it’s converting to UTC.
Notice the hour is originally 08 with a 7 hour time zone offset.
Then, with the Zap Code step with JavaScript, it’s converted to UTC as “2021-10-25T15:06:08.000Z”.
Notice the hour is now 15 and there is no time zone offset.