当前位置:网站首页>Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间) 日期格式化
Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间) 日期格式化
2022-06-30 07:22:00 【蓝胖子的多啦A梦】
1、 Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间) 转换为 2022-06-28 15:30:29
代码如下
const d = new Date(Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间))
const resDate = d.getFullYear() + '-' + this.p((d.getMonth() + 1)) + '-' + this.p(d.getDate())
const resTime = this.p(d.getHours()) + ':' + this.p(d.getMinutes()) + ':' + this.p(d.getSeconds())
p为不够10添加0的函数
p(s) {
return s < 10 ? '0' + s : s
},
2、 2022-06-28 15:30:29转换为 Tue Jun 28 2022 15:30:29 GMT+0800 (中国标准时间)
代码如下
parserDate(date) {
var t = Date.parse(date)
if (!isNaN(t)) {
return new Date(Date.parse(date.replace(/-/g, '/')))
}
},
边栏推荐
- STM32 control LED lamp
- 期末复习-PHP学习笔记2-PHP语言基础
- Basic knowledge points
- Final review -php learning notes 11-php-pdo database abstraction layer
- DXP software uses shortcut keys
- Firewall firewalld
- C language implementation sequence stack
- Common sorting methods
- Efga design open source framework openlane series (I) development environment construction
- January 23, 2022 [reading notes] - bioinformatics and functional genomics (Chapter 6: multiple sequence alignment)
猜你喜欢

Network, network card and IP configuration
![November 16, 2021 [reading notes] - macro genome analysis process](/img/c4/4c74ff1b4049f5532c871eb00d5ae7.jpg)
November 16, 2021 [reading notes] - macro genome analysis process

期末复习-PHP学习笔记1

At the age of 25, I started to work in the Tiankeng industry with buckets. After going through a lot of hardships to become a programmer, my spring finally came

2022 Research Report on China's intelligent fiscal and tax Market: accurate positioning, integration and diversity

Self study notes -- use of 74h573

2021 China Enterprise Cloud index insight Report

深度学习——特征点检测和目标检测
![November 21, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)](/img/20/bbb6e740df96250016147c54bc6cc1.jpg)
November 21, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)

Permutation and combination of probability
随机推荐
PMIC power management
DXP shortcut key
Assembly learning register
Halcon: read the camera and binary it
2022 Research Report on China's intelligent fiscal and tax Market: accurate positioning, integration and diversity
Investment and financing analysis report of Supply Chain & logistics industry in 2021
November 19, 2021 [reading notes] a summary of common problems of sneakemake (Part 2)
November 9, 2020 [wgs/gwas] - whole genome analysis (association analysis) process (Part 2)
Log service management
STM32 control LED lamp
Video player (II): video decoding
Similarities and differences of differential signal, common mode signal and single ended signal (2022.2.14)
線程池——C語言
深度学习——循环神经网络
Basic theory of four elements and its application
December 19, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)
1、 Output debugging information: makefile file debugging information $(warning "tests" $(mkfile\u path)); makefile file path
Thread pool - C language
Distance from point to line
Digital white paper on total cost management in chain operation industry