Moment.js – How To Detect Daylight Savings Time And Add One Day

To detect DST, use the .isDST() method: http://momentjs.com/docs/#/query/is-daylight-saving-time/

moment([2011, 2, 12]).isDST(); // false, March 12 2011 is not DST
moment([2011, 2, 14]).isDST(); // true, March 14 2011 is DST

Using this test, you should be able to determine how to modify your program’s behavior accordingly.

Leave a Comment