当前位置:网站首页>指定格式时间,月份天数前补零
指定格式时间,月份天数前补零
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');
边栏推荐
- [exercise-4] (UVA 11988) broken keyboard = = (linked list)
- Find 3-friendly Integers
- Candy delivery (Mathematics)
- Flag framework configures loguru logstore
- Is the sanic asynchronous framework really so strong? Find truth in practice
- 860. Lemonade change
- 第 300 场周赛 - 力扣(LeetCode)
- C language learning notes
- JS call camera
- Penetration test 2 --- XSS, CSRF, file upload, file inclusion, deserialization vulnerability
猜你喜欢
1005. Maximized array sum after K negations
Programmers, what are your skills in code writing?
【练习-4】(Uva 11988)Broken Keyboard(破损的键盘) ==(链表)
Information security - threat detection - Flink broadcast stream broadcaststate dual stream merging application in filtering security logs
1605. Sum the feasible matrix for a given row and column
Penetration test (7) -- vulnerability scanning tool Nessus
Information security - threat detection - detailed design of NAT log access threat detection platform
X-forwarded-for details, how to get the client IP
树莓派4B64位系统安装miniconda(折腾了几天终于解决)
Analysis of protobuf format of real-time barrage and historical barrage at station B
随机推荐
D - function (HDU - 6546) girls' competition
Quick to typescript Guide
快速转 TypeScript 指南
[analysis of teacher Gao's software needs] collection of exercises and answers for level 20 cloud class
Openwrt source code generation image
Common configuration files of SSM framework
Basic Q & A of introductory C language
1013. Divide the array into three parts equal to and
Penetration test (3) -- Metasploit framework (MSF)
树莓派4B安装opencv3.4.0
921. Minimum additions to make parentheses valid
Interval sum ----- discretization
“鬼鬼祟祟的”新小行星将在本周安全掠过地球:如何观看
Information security - Analysis of security orchestration automation and response (soar) technology
Opencv learning log 28 -- detect the red cup cover
Penetration test 2 --- XSS, CSRF, file upload, file inclusion, deserialization vulnerability
Information security - threat detection - detailed design of NAT log access threat detection platform
1855. Maximum distance of subscript alignment
QT有关QCobobox控件的样式设置(圆角、下拉框,向上展开、可编辑、内部布局等)
【练习-5】(Uva 839)Not so Mobile(天平)