moment.tz("2012-11-04 01:00:00-05:00", "America/New_York");
anyone know how do we get the different offsets and different TZ's for that region? for example: for "America/Chicago" I need CDT
and CST
along with their offsets so that I can get the appropriate dates based on user selection
moment.tz.zone("America/Chicago")
) and get the unique offsets and unique abbrs. Is there an easier way? Still cant find a way to find if time provided is ambiguous or not
npm install moment moment-timezone
, and they are available, but moment("2015-01-01T00:00:00 America/New_York")
returns null whereas moment("2015-01-01T00:00:00-05:00")
works
moment("2015-01-01T00:00:00 America/New_York")
. I just tested moment.tz("2015-01-01T00:00:00", "America/New_York")
and that works fine.
I'm stuck on a problem and would really appreciate some help.
I'm trying to use moment-timezone to schedule an event based on the users time zone. ie, User lives in Denver and should receive a push notification at a given time, regardless of the servers time. I have the users time zone and their chosen delivery time/date. No matter what I do, I can't get it to work. I know I'm missing something small, but this is killin' me lol
moment().unix()
, or in milliseconds that's moment().valueOf()
, or just +moment()
moment("2017-06-16T13:10:02.180Z").unix()
or moment("2017-06-16T13:10:02.180Z").valueOf()
or +moment("2017-06-16T13:10:02.180Z")
Hello, I'm just looking to contribute. Here is a regular expression to parse the timezone from a date/time string. It works with the new and old format strings.
"date.toString() or date.toTimeString()".replace(/^.* (\([A-Za-z ]+\)|[A-Z]{3}).*$/, '$1').replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/, '$1$2$3');
Credit goes to "Mootools More" Date module but I had to modify the first RE since it didn't work with the new string format.