I'm getting: Moment Timezone has no data for PST. See http://momentjs.com/timezone/docs/#/data-loading/. when running the following code in Node.JS:
var departure = moment.tz('2015-09-16 16:05', 'YYYY-MM-DD HH:mm', 'PST');
However this code seems to work:
var arrival = moment.tz('2015-09-16 17:05', 'YYYY-MM-DD HH:mm', 'EST');
So it appears that it doesn't like the PST timezone. (Also tried with PDT and EDT and it wouldn't work with either)
We rely on the tzdb for source data.
EST exists as a zone entry for backwards compatibility reasons in the tzdb, but it is fixed to EST and does not switch to EDT for daylight saving time.PST does not exist as a zone entry in the tzdb."America/Los_Angeles". For Eastern time, use "America/New_York"utcOffset function in moment. You don't need moment-timezone.I'm facing some issue in time xone
var dec = moment("2016-12-01T12:00:00Z");
dec.tz('America/Los_Angeles').format('ha z'); // 4am PST
Result : "5am PDT"
But it should return in PST format ...
I suspect , the issue is in data loading
moment.tz.add('America/Los_Angeles|PST PDT|80 70|0101|1Lzm0 1zb0 Op0');
If i switch the location of PST and PDT always returns PST not in PDT .
@satkamar - This doesn't belong on this thread. Commenting on old, closed, unrelated issues is a sure way to get ignored. I'll be happy to answer your question if you create a new issue. Thanks.
Is moment timezone reflects for PST and PDT?
@webmaster1990 The timezone is not there by default, adding explicitely. So you have to load the data
like,
moment.tz.add("America/Los_Angeles|PST PDT|80 70|01010101010101010101010|1BQW0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Rd0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0 Op0 1zb0|15e6");
Just use the moment-timezone "with data" files available on the home page or through your favorite CDN.
Most helpful comment
We rely on the tzdb for source data.
ESTexists as a zone entry for backwards compatibility reasons in the tzdb, but it is fixed to EST and does not switch to EDT for daylight saving time.PSTdoes not exist as a zone entry in the tzdb."America/Los_Angeles". For Eastern time, use"America/New_York"utcOffsetfunction in moment. You don't need moment-timezone.