当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- Suffix expression (greed + thinking)
- AcWing:第58场周赛
- 1323. Maximum number of 6 and 9
- Flask框架配置loguru日志庫
- 1605. Sum the feasible matrix for a given row and column
- Opencv learning log 29 -- gamma correction
- 【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
- 1689. Ten - the minimum number of binary numbers
- Interesting drink
- Share an example of running dash application in raspberry pie.
猜你喜欢

807. Maintain the urban skyline

Configuration du cadre flask loguru log Library

Problem - 922D、Robot Vacuum Cleaner - Codeforces

Information security - threat detection engine - common rule engine base performance comparison

C language is the watershed between low-level and high-level

1689. Ten - the minimum number of binary numbers

Write web games in C language

Penetration test (2) -- penetration test system, target, GoogleHacking, Kali tool

Penetration test 2 --- XSS, CSRF, file upload, file inclusion, deserialization vulnerability

1605. Sum the feasible matrix for a given row and column
随机推荐
New to redis
Borg maze (bfs+ minimum spanning tree) (problem solving report)
渗透测试 ( 8 ) --- Burp Suite Pro 官方文档
MySQL grants the user the operation permission of the specified content
[exercise-1] (UVA 673) parentheses balance/ balanced brackets (stack)
The concept of C language array
树莓派4B64位系统安装miniconda(折腾了几天终于解决)
渗透测试 ( 1 ) --- 必备 工具、导航
Penetration test (1) -- necessary tools, navigation
Find 3-friendly Integers
605. Planting flowers
1529. Minimum number of suffix flips
Programmers, what are your skills in code writing?
栈的经典应用—括号匹配问题
Opencv learning log 27 -- chip positioning
【练习-6】(Uva 725)Division(除法)== 暴力
Openwrt source code generation image
渗透测试 ( 7 ) --- 漏洞扫描工具 Nessus
QT模拟鼠标事件,实现点击双击移动拖拽等
frida hook so层、protobuf 数据解析