moment使用指南
来源:互联网 发布:淘宝客链接手机端转换 编辑:程序博客网 时间:2024/06/06 06:54
1、日期格式化
moment().format('YYYY-MM-DD HH:mm:ss')
2、momentJS时间差计算
console.log(moment().format("YYYY-MM-DD HH:mm:ss")); //当前时间
console.log(moment().subtract(10, "days").format("YYYY-MM-DD")); //当前时间的前10天时间
console.log(moment().subtract(1, "years").format("YYYY-MM-DD")); //当前时间的前1年时间
console.log(moment().subtract(3, "months").format("YYYY-MM-DD")); //当前时间的前3个月时间
console.log(moment().subtract(1, "weeks").format("YYYY-MM-DD")); //当前时间的前一个星期时间
阅读全文
0 0
- moment使用指南
- Moment
- moment
- moment
- The Moment
- The Moment
- The Moment...
- Moment.js
- moment.js
- moment.js
- moment.js
- Moment.js
- Flask-Moment
- My Proudest Moment
- Dear diary moment
- My feelings this moment
- sicily 1252(Defining Moment)
- Sicily 1252. Defining Moment
- SVN 提交报错:“Previous operation has not finished; run 'commit' if it was interrupted”
- SVM参数介绍
- hdu 1667 The Rotation Game(IDA*)
- 成为优秀Java程序员的10个要点
- 第二十篇:并发新特性—Lock锁和条件变量(含代码)
- moment使用指南
- ZOJ 3228 Searching the String (AC自动机)
- 2017.8.18多线程
- 8.21模拟赛
- Xmap与Jaxb
- JEESZ分布式框架--单点登录集成方案
- Android圆形头像设置(实现相机、相册选择并裁剪)兼容6.0/7.0
- linux定时任务的设置 crontab 配置指南
- app测试要点(3)