当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- Codeforces Round #801 (Div. 2)A~C
- 力扣——第298场周赛
- 【练习-1】(Uva 673) Parentheses Balance/平衡的括号 (栈stack)
- [exercise-3] (UVA 442) matrix chain multiplication
- QT有关QCobobox控件的样式设置(圆角、下拉框,向上展开、可编辑、内部布局等)
- Advancedinstaller安装包自定义操作打开文件
- Information security - threat detection - detailed design of NAT log access threat detection platform
- [exercise-9] Zombie's Treasury test
- Borg maze (bfs+ minimum spanning tree) (problem solving report)
- Read and save zarr files
猜你喜欢

Information security - threat detection - detailed design of NAT log access threat detection platform

力扣——第298场周赛

1323. Maximum number of 6 and 9

1689. Ten - the minimum number of binary numbers

Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures

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

Penetration testing (5) -- a collection of practical skills of scanning King nmap and penetration testing tools

605. Planting flowers

【练习-7】Crossword Answers

读取和保存zarr文件
随机推荐
F - birthday cake (Shandong race)
Maximum product (greedy)
渗透测试 ( 5 ) --- 扫描之王 nmap、渗透测试工具实战技巧合集
【练习-3】(Uva 442)Matrix Chain Multiplication(矩阵链乘)
window11 conda安装pytorch过程中遇到的一些问题
JS call camera
CEP used by Flink
1005. Maximized array sum after K negations
[exercise-2] (UVA 712) s-trees
Common configuration files of SSM framework
Vs2019 initial use
The most complete programming language online API document
【练习-10】 Unread Messages(未读消息)
QNetworkAccessManager实现ftp功能总结
力扣:第81场双周赛
frida hook so层、protobuf 数据解析
[exercise-7] crossover answers
[exercise -11] 4 values why sum is 0 (and 4 values of 0)
B - Code Party (girls' competition)
969. Pancake sorting