当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- Penetration test (7) -- vulnerability scanning tool Nessus
- Information security - Analysis of security orchestration automation and response (soar) technology
- (POJ - 3258) River hopper (two points)
- Analysis of protobuf format of real-time barrage and historical barrage at station B
- 渗透测试 ( 1 ) --- 必备 工具、导航
- [exercise-7] crossover answers
- Problem - 922D、Robot Vacuum Cleaner - Codeforces
- Maximum product (greedy)
- [exercise-7] (UVA 10976) fractions again?! (fraction split)
- Advancedinstaller安装包自定义操作打开文件
猜你喜欢
2027. Minimum number of operations to convert strings
Differential (one-dimensional, two-dimensional, three-dimensional) Blue Bridge Cup three body attack
X-forwarded-for details, how to get the client IP
Information security - threat detection engine - common rule engine base performance comparison
(POJ - 3579) median (two points)
Maximum product (greedy)
渗透测试 ( 1 ) --- 必备 工具、导航
1689. Ten - the minimum number of binary numbers
409. Longest palindrome
Analyse du format protobuf du rideau en temps réel et du rideau historique de la station B
随机推荐
Quick to typescript Guide
“鬼鬼祟祟的”新小行星将在本周安全掠过地球:如何观看
1529. Minimum number of suffix flips
Problem - 922D、Robot Vacuum Cleaner - Codeforces
Analysis of protobuf format of real-time barrage and historical barrage at station B
Interesting drink
QT有关QCobobox控件的样式设置(圆角、下拉框,向上展开、可编辑、内部布局等)
921. Minimum additions to make parentheses valid
Analyse du format protobuf du rideau en temps réel et du rideau historique de la station B
New to redis
渗透测试 ( 3 ) --- Metasploit Framework ( MSF )
Flag framework configures loguru logstore
Penetration test (3) -- Metasploit framework (MSF)
Codeforces Round #803 (Div. 2)A~C
Penetration test (2) -- penetration test system, target, GoogleHacking, Kali tool
Information security - Analysis of security orchestration automation and response (soar) technology
Differential (one-dimensional, two-dimensional, three-dimensional) Blue Bridge Cup three body attack
Information security - threat detection - detailed design of NAT log access threat detection platform
C language learning notes
【练习-10】 Unread Messages(未读消息)