带有moment.js的.setHours(0,0,0,0) [英] .setHours(0,0,0,0) with moment.js
本文介绍了带有moment.js的.setHours(0,0,0,0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用moment.js时,最简单的 date.setHours(0,0,0,0)
是什么?
What is the easiest equivalent of date.setHours(0,0,0,0)
when using moment.js?
基本上,如果我需要新的Date()
时刻,小时,分钟,秒和毫秒归零。
Basically, if I need a new Date()
moment with hours, minutes, seconds, and milliseconds zeroed out.
推荐答案
moment().startOf('day')
这篇关于带有moment.js的.setHours(0,0,0,0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文