.setHours(0,0,0,0) with moment.js
What is the easiest equivalent of date.setHours(0,0,0,0)
when using moment.js?
Basically, if I need a new Date()
moment with hours, minutes, seconds, and milliseconds zeroed out.
Start of Time
moment().startOf('day')
Suppose date is the moment object which contains the date having some hours and minutes.
You can use the following code to reset hours, minutes and seconds to 0.
date.utcOffset(0);
date.set({
hour: 0,
minute: 0,
second: 0,
millisecond: 0,
});