当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
2022-07-06 09:28:00 【梦想身高1米8】
antd DatePicker选中的时间,可以用format格式化:
https://blog.csdn.net/weixin_43915401/article/details/112880693
js获取时间方法:
https://blog.csdn.net/weixin_43915401/article/details/114014926
js生成指定格式的时间,只能自己拼,就。。。补充一下,填充字符串的方法吧。padStart(2,'0')2位字符串,不足两位的,在前面补零。
let date = new Date();
YYYY-MM-DD = date.getFullYear() + '-'
+ (date.getMonth() + 1).toString().padStart(2, '0') + '-'
+ (date.getDate()).toString().padStart(2, '0');
边栏推荐
- [exercise-6] (PTA) divide and conquer
- QT按钮点击切换QLineEdit焦点(含代码)
- Codeforces Round #803 (Div. 2)A~C
- 最全编程语言在线 API 文档
- AcWing:第58场周赛
- [exercise-7] (UVA 10976) fractions again?! (fraction split)
- 628. Maximum product of three numbers
- 1013. Divide the array into three parts equal to and
- [exercise -11] 4 values why sum is 0 (and 4 values of 0)
- Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
猜你喜欢

B - Code Party (girls' competition)

pytorch提取骨架(可微)

QT按钮点击切换QLineEdit焦点(含代码)

滲透測試 ( 1 ) --- 必備 工具、導航

QT实现圆角窗口

Candy delivery (Mathematics)

Configuration du cadre flask loguru log Library

Programmers, what are your skills in code writing?

Penetration test (4) -- detailed explanation of meterpreter command

X-forwarded-for details, how to get the client IP
随机推荐
[exercise-1] (UVA 673) parentheses balance/ balanced brackets (stack)
[exercise-7] (UVA 10976) fractions again?! (fraction split)
QWidget代码设置样式表探讨
b站 实时弹幕和历史弹幕 Protobuf 格式解析
807. Maintain the urban skyline
双向链表—全部操作
QT模拟鼠标事件,实现点击双击移动拖拽等
QT实现圆角窗口
[exercise -10] unread messages
B - Code Party (girls' competition)
Programmers, what are your skills in code writing?
E. Breaking the Wall
Penetration test (8) -- official document of burp Suite Pro
【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
1855. Maximum distance of subscript alignment
日期加1天
Openwrt build Hello ipk
Opencv learning log 27 -- chip positioning
力扣——第298场周赛
快速转 TypeScript 指南