当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- X-forwarded-for details, how to get the client IP
- B - Code Party (girls' competition)
- 1323. Maximum number of 6 and 9
- Penetration test 2 --- XSS, CSRF, file upload, file inclusion, deserialization vulnerability
- 【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
- Information security - security professional name | CVE | rce | POC | Vul | 0day
- HDU - 6024 building shops (girls' competition)
- Maximum product (greedy)
- Shell Scripting
- C language must memorize code Encyclopedia
猜你喜欢
Some problems encountered in installing pytorch in windows11 CONDA
Read and save zarr files
Pytorch extract skeleton (differentiable)
Codeforces Round #802(Div. 2)A~D
QT按钮点击切换QLineEdit焦点(含代码)
B - Code Party (girls' competition)
MySQL import database error [err] 1273 - unknown collation: 'utf8mb4_ 0900_ ai_ ci’
QWidget代码设置样式表探讨
Pyside6 signal, slot
The "sneaky" new asteroid will pass the earth safely this week: how to watch it
随机推荐
MySQL import database error [err] 1273 - unknown collation: 'utf8mb4_ 0900_ ai_ ci’
Sanic异步框架真的这么强吗?实践中找真理
(POJ - 3579) median (two points)
Differential (one-dimensional, two-dimensional, three-dimensional) Blue Bridge Cup three body attack
[exercise 4-1] cake distribution
Ball Dropping
Auto.js入门
Flag framework configures loguru logstore
1005. Maximized array sum after K negations
最全编程语言在线 API 文档
[exercise-7] crossover answers
807. Maintain the urban skyline
Gartner: five suggestions on best practices for zero trust network access
Understand what is a programming language in a popular way
渗透测试 ( 3 ) --- Metasploit Framework ( MSF )
7-1 understand everything (20 points)
1903. Maximum odd number in string
Information security - threat detection engine - common rule engine base performance comparison
Is the sanic asynchronous framework really so strong? Find truth in practice
Information security - threat detection - detailed design of NAT log access threat detection platform