当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- HDU - 6024 building shops (girls' competition)
- Pytorch extract skeleton (differentiable)
- 最全编程语言在线 API 文档
- 树莓派4B64位系统安装miniconda(折腾了几天终于解决)
- Share an example of running dash application in raspberry pie.
- “鬼鬼祟祟的”新小行星将在本周安全掠过地球:如何观看
- 渗透测试 ( 4 ) --- Meterpreter 命令详解
- 【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
- Auto. Getting started with JS
- 【练习-8】(Uva 246)10-20-30==模拟
猜你喜欢
b站 实时弹幕和历史弹幕 Protobuf 格式解析
Maximum product (greedy)
The concept of C language array
605. Planting flowers
【练习-7】Crossword Answers
“鬼鬼祟祟的”新小行星将在本周安全掠过地球:如何观看
Candy delivery (Mathematics)
Basic Q & A of introductory C language
渗透测试 2 --- XSS、CSRF、文件上传、文件包含、反序列化漏洞
Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
随机推荐
【练习-5】(Uva 839)Not so Mobile(天平)
Opencv learning log 24 -- Hough transform 2 (maximum interval and minimum length can be limited)
【练习-2】(Uva 712) S-Trees (S树)
Some problems encountered in installing pytorch in windows11 CONDA
快速转 TypeScript 指南
Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
Codeforces Round #803 (Div. 2)A~C
渗透测试 ( 4 ) --- Meterpreter 命令详解
Flag framework configures loguru logstore
Penetration testing (5) -- a collection of practical skills of scanning King nmap and penetration testing tools
Penetration test (4) -- detailed explanation of meterpreter command
[exercise-4] (UVA 11988) broken keyboard = = (linked list)
Penetration test (8) -- official document of burp Suite Pro
图图的学习笔记-进程
力扣——第298场周赛
Vs2019 initial use
Basic Q & A of introductory C language
2027. Minimum number of operations to convert strings
树莓派4B64位系统安装miniconda(折腾了几天终于解决)
7-1 understand everything (20 points)