Determining Timezone with moment.js

Stephen Dolenski:
Is it possible to determine Timezone info when submitting a form?


Owen Reese:
Yes, moment.js can return the time zone based on the browser. I use moment.js to write to the data model to pass that info to FMS


Stephen Dolenski:
is there an example of this?


Owen Reese:
I don’t think there is an example. But it’s pretty simple. Here’s my code that grabs the time zone offset:

var offset = new Date().getTimezoneOffset();
model.browserTimestampOffset = offset;

Owen Reese:
Here’s moment’s docs - they are pretty straightforward. It’s very powerful library


Owen Reese:
https://momentjs.com/


Stephen Dolenski:
thanks i will try this.