moment.js 对时间变量进行管理
2017-03-13 17:54
323 查看
安装:
相关函数:
bower install moment --save # bower npm install moment --save # npm Install-Package Moment.js # NuGet spm install moment --save # spm meteor add momentjs:moment # meteor
相关函数:
moment().format('MMMM Do YYYY, h:mm:ss a'); // March 13th 2017, 5:54:37 pm moment().format('dddd'); // Monday moment().format("MMM Do YY"); // Mar 13th 17 moment().format('YYYY [escaped] YYYY'); // 2017 escaped 2017 moment().format(); // 2017-03-13T17:54:37+08:00
moment().format('MMMM Do YYYY, h:mm:ss a'); // March 13th 2017, 5:54:37 pm moment().format('dddd'); // Monday moment().format("MMM Do YY"); // Mar 13th 17 moment().format('YYYY [escaped] YYYY'); // 2017 escaped 2017 moment().format(); // 2017-03-13T17:54:37+08:00
moment().subtract(10, 'days').calendar(); // 03/03/2017 moment().subtract(6, 'days').calendar(); // Last Tuesday at 5:55 PM moment().subtract(3, 'days').calendar(); // Last Friday at 5:55 PM moment().subtract(1, 'days').calendar(); // Yesterday at 5:55 PM moment().calendar(); // Today at 5:55 PM moment().add(1, 'days').calendar(); // Tomorrow at 5:55 PM moment().add(3, 'days').calendar(); // Thursday at 5:55 PM moment().add(10, 'days').calendar(); // 03/23/201
moment.locale(); // en moment().format('LT'); // 5:58 PM moment().format('LTS'); // 5:58:11 PM moment().format('L'); // 03/13/2017 moment().format('l'); // 3/13/2017 moment().format('LL'); // March 13, 2017 moment().format('ll'); // Mar 13, 2017 moment().format('LLL'); // March 13, 2017 5:58 PM moment().format('lll'); // Mar 13, 2017 5:58 PM moment().format('LLLL'); // Monday, March 13, 2017 5:58 PM moment().format('llll'); // Mon, Mar 13, 2017 5:58 PM
相关文章推荐
- 使用moment.js轻松管理日期和时间
- 使用moment.js轻松管理日期和时间
- 使用moment.js管理时间
- moment.js 日期和时间管理 24小时制
- 时间处理工具 moment.js:管理时间和日期,so easy!
- 【Flask】 使用Flask-Moment进行日期时间的管理
- [转] 使用moment.js轻松管理日期和时间
- 使用moment.js轻松管理日期和时间
- 使用moment.js轻松管理日期和时间
- Moment.js进行时间类型转换
- moment.js常用时间示例,时间管理
- 使用moment.js轻松管理日期和时间
- moment.js 日期和时间管理 24小时制
- 使用moment.js轻松管理日期和时间
- moment.js 日期和时间管理 24小时制
- 使用moment.js轻松管理日期和时间
- 使用moment.js轻松管理日期和时间
- 使用moment.js轻松管理日期和时间
- 使用emacs的org-mode进行时间管理(四)——agenda view
- 指导如何利用手机电脑进行时间管理