当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- 渗透测试 ( 2 ) --- 渗透测试系统、靶机、GoogleHacking、kali工具
- [exercise-4] (UVA 11988) broken keyboard = = (linked list)
- Openwrt source code generation image
- 渗透测试 ( 7 ) --- 漏洞扫描工具 Nessus
- [exercise-2] (UVA 712) s-trees
- 【练习-6】(Uva 725)Division(除法)== 暴力
- New to redis
- 7-1 understand everything (20 points)
- MySQL grants the user the operation permission of the specified content
- 969. Pancake sorting
猜你喜欢
渗透测试 ( 1 ) --- 必备 工具、导航
Write web games in C language
Openwrt build Hello ipk
TCP's three handshakes and four waves
QWidget代码设置样式表探讨
Information security - Epic vulnerability log4j vulnerability mechanism and preventive measures
树莓派4B64位系统安装miniconda(折腾了几天终于解决)
409. Longest palindrome
969. Pancake sorting
滲透測試 ( 1 ) --- 必備 工具、導航
随机推荐
409. Longest palindrome
PySide6 信号、槽
The most complete programming language online API document
【练习-7】(Uva 10976)Fractions Again?!(分数拆分)
【练习-6】(Uva 725)Division(除法)== 暴力
7-1 understand everything (20 points)
JS call camera
树莓派CSI/USB摄像头使用mjpg实现网页摄像头监控
力扣——第298场周赛
【练习-5】(Uva 839)Not so Mobile(天平)
What is the difficulty of programming?
树莓派4B安装opencv3.4.0
渗透测试 ( 2 ) --- 渗透测试系统、靶机、GoogleHacking、kali工具
Configuration du cadre flask loguru log Library
Information security - Analysis of security orchestration automation and response (soar) technology
QNetworkAccessManager实现ftp功能总结
Hdu-6025-prime sequence (girls' competition)
Socket communication
F - birthday cake (Shandong race)
(POJ - 3258) River hopper (two points)