.setHours(0,0,0,0) with moment.js

2019-02-11 10:33发布

问题:

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.

回答1:

Start of Time

moment().startOf('day')