momentjs 有没有类似于 joda-time 的 localDate 的东西?如果不是,最好使用 .startOf 吗?

Does momentjs have something similar to joda-time's localDate? If not, is it best to use .startOf?

在joda-time库中(我假设Java 8的新时间库),你可以忽略时间和时区:https://www.joda.org/joda-time/apidocs/org/joda/time/LocalDate.html

我宁愿避免在我的小应用程序中加入时间因素。我只想让用户看到他们的本地日期。有没有等同于localdate的momentjs?如果不是,最好的解决方法是使用 .startOf() 吗?谢谢

编辑:需要说明的是,这不是格式问题。

"moment默认按当地时间解析显示。

如果要解析或显示 UTC 时刻,可以使用 moment.utc()"

正如解释的那样here

moment().format();     // 2013-02-04T10:35:24-08:00 (local date)
moment.utc().format(); // 2013-02-04T18:35:24+00:00 (UTC date)