当前位置:网站首页>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
边栏推荐
猜你喜欢
随机推荐
对STL容器的理解
防抖和节流
BTree、B+Tree和HASH索引
8.分页查询
[self motivation series] what really hinders you?
7.子查询
反思 | Android 音视频缓存机制的系统性设计
Mobile game performance optimization
SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)
Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
js之函数的两种声明方式
6. Aggregation function and grouping statistics
NPM installation stepping pit
js之什么是事件?事件三要素以及操作元素
[牛客挑战赛47]C.条件 (bitset加速floyd)
keytool: command not found
Two threads print odd and even numbers interactively
SAP ECC连接SAP PI系统配置
1. View databases and tables
自定义时间格式(YYYY-MM-DD HH:mm:ss 星期X)









