How to set 00:00:00 using moment.js

The Solution to How to set 00:00:00 using moment.js is


Moment.js stores dates it utc and can apply different timezones to it. By default it applies your local timezone. If you want to set time on utc date time you need to specify utc timezone.

Try the following code:

var m = moment().utcOffset(0);
m.set({hour:0,minute:0,second:0,millisecond:0})
m.toISOString()
m.format()

~ Answered on 2016-01-13 09:18:57


Most Viewed Questions: