miment 脱身与 moment, 相比于moment,更加轻量化,源文件1K左右
miment github:Miment/README-cn.md at master · noahlam/Miment (github.com)
moment:Moment.js 中文网
1.标准时间:
new Date() = "2020-11-26T01:41:26.248Z"
2.时间戳:
new Date().getTime() = 1606354886248
3.标准时间转为年月日时分秒:
miment(new Date()).format('YYYY-MM-DD hh:mm:ss') = 2020-11-26 09:41:26
时间戳转年月日时分秒:
miment(new Date().getTime()).format('YYYY-MM-DD hh:mm:ss') = 2020-11-26 09:41:26
4.年月日时分秒(时间戳)转为标准时间:miment(xxx)/moment(xxx)
miment(2020-11-26 09:41:26) = "2020-11-26T01:41:26.000Z"
年月日时分秒转为时间戳:
miment(2020-11-26 09:41:26).getTime() = 1606354886000
moment(2020-11-26 09:41:26).valueOf() = 1606354886000