当前位置:网站首页>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
边栏推荐
猜你喜欢
SAP DEBUG调试FOR IN、REDUCE等复杂的语句
keytool: command not found
反思 | 事件总线的局限性,组件化开发流程中通信机制的设计与实现
Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
数据分析入门 | kaggle泰坦尼克任务(三)—>探索数据分析
SAP CR传输请求顺序、依赖检查
js之预解析
自定义时间格式(YYYY-MM-DD HH:mm:ss 星期X)
js之节点操作,为什么要学习节点操作
反思|开启B站少女心模式,探究APP换肤机制的设计与实现
随机推荐
CSDN很火的汤小洋老师全部课程总共有哪些(问号问号问号)
8.分页查询
3. Sort statement
9. Common functions
FSM有限状态机
SAP pi / PO rfc2restful publishing RFC interface is a restful example (proxy indirect method)
4. Multi table query
Date对象(js内置对象)
SAP RFC_CVI_EI_INBOUND_MAIN BP主数据创建示例(仅演示客户)
js之排他思想及案例
[hdu6833]A Very Easy Math Problem(莫比乌斯反演)
Reflect on the limitations of event bus and the design and implementation of communication mechanism in component development process
数组扁平化
Mysql 数据库从设计上的优化
[self motivation series] what really hinders you?
13.用户和权限管理
SAP pi / PO rfc2soap publishes RFC interface as WS example
【自我激励系列】你永远不会准备好
刨根问底---cocos2d源码的理解与分析
反转链表练习