当前位置:网站首页>Moment. Format of format method function in JS
Moment. Format of format method function in JS
2022-04-23 07:45:00 【Senior salted fish~】
moment().format( Parameters ) Returns the current date format set by the parameter
example : Parameter is ‘YYYY-MM-DD HH:mm:ss’
See the figure below for details :
| Format code | explain | Return value |
| M | The number of months , No leading zeros | 1-12 |
| MM | The number of months , There are leading zeros | 01-12 |
| MMM | Three letter abbreviations for the month | Jan-Dec |
| MMMM | month , Full text format | January-December |
| Q | quarter | 1-4 |
| D | The day of the month , No leading zeros | 1-31 |
| DD | The day of the month , There are leading zeros | 01-31 |
| d | Day of the week , Digital representation | 0-6,0 It's Sunday ,1-6 From Monday to Saturday |
| ddd | Three letters indicate the day of the week | Sun-Sat |
| dddd | What day , Complete text mode | from Sunday-Saturday |
| w | The week of the year | Such as 27: It means the first one 27 Zhou |
| YYYY | The full year represented by four digits | Such as :2021 |
| YY | Two digits indicate the year | Such as :21 |
| A | uppercase AM PM | AM PM |
| a | Lowercase am pm | am pm |
| HH | Hours ,24 hourly , There are leading zeros | 00-23 |
| H | Hours ,24 hourly , No leading zeros | 0-23 |
| hh | Hours ,12 hourly , There are leading zeros |
00-12 |
| h | Hours ,12 hourly , No leading zeros | 0-12 |
| m | minute , No leading zeros | 0-59 |
| mm | minute , There are leading zeros | 00-59 |
| s | Number of seconds , No leading zeros | 1-59 |
| ss | Number of seconds , There are leading zeros | 01-59 |
| X | Unix Time stamp | 1298372741 |
版权声明
本文为[Senior salted fish~]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230623087172.html
边栏推荐
猜你喜欢
随机推荐
简单理解==和equals,String为什么可以不用new
SAP pi / PO rfc2soap publishes RFC interface as WS example
Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
Mysql 索引
2. Restricted query
AuthorizationServer(授权服务器的简单搭建)
ABAP 7.4 SQL Window Expression
redis连接出错 ERR AUTH <password> called without any password configured for the default user.
F-牛妹的苹果树(直径合并)
积性函数与迪利克雷卷积
每日一题 | 曾被反转链表支配的恐惧
url转成对象
7. sub query
Mobile game performance optimization
ABAP 实现发布RESTful服务供外部调用示例
js之自定义属性以及H5中如何判断自定义属性
防抖和节流
12. Constraints
Date对象(js内置对象)
10. Update operation









