I'm trying to see that the DST date has moved , and I can get it to work without telling Moment.js which time zone I am in, so it will select my local time zone, but I would like to tell Moment.js where the time is located. the date is in, but I can't get it to work. Any ideas?
moment.tz.add(['America/New_York|EST EDT|50 40|0101|1Lz50 1zb0 Op0']);
document.write(moment('2014-03-31T02:00:00+02:00', moment.ISO_8601).isDSTShifted());
document.write('<br><br>');
document.write(moment('2014-03-31T02:30:00+02:00').isDSTShifted());
document.write('<br><br>');
document.write(moment.tz('2013-03-10 02:30:00', 'America/New_York').isDSTShifted());
document.write('<br><br>');
document.write(moment('2013-03-10 2:30', 'YYYY-MM-DD HH:mm').isDSTShifted());
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.8.3/moment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/moment-timezone/0.2.2/moment-timezone.min.js"></script>
Run codeHide result
source
share