当前位置:网站首页>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, '/')))
}
},
边栏推荐
- January 23, 2022 [reading notes] - bioinformatics and functional genomics (Chapter 6: multiple sequence alignment)
- 期末复习-PHP学习笔记1
- Xiashuo think tank: 50 planet updates reported today (including the global architects Summit Series)
- 冰冰学习笔记:快速排序
- Log service management
- C language operators
- DS1302 digital tube clock
- Introduction notes to pytorch deep learning (10) neural network convolution layer
- Disk space, logical volume
- Implementation of double linked list in C language
猜你喜欢
Multi whale capital: report on China's education intelligent hardware industry in 2022
July 30, 2021 [wgs/gwas] - whole genome analysis process (Part I)
2022 retail industry strategy: three strategies for consumer goods gold digging (in depth)
C51 minimum system board infrared remote control LED light on and off
Parameter calculation of deep learning convolution neural network
Final review -php learning notes 1
期末複習-PHP學習筆記5-PHP數組
Basic knowledge of compiling learning records
Periodic planning work
November 21, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)
随机推荐
December 19, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)
Video player (I): process
STM32 infrared communication
November 22, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5, section 4, hidden Markov model)
为什么大学毕业了还不知道干什么?
November 22, 2021 [reading notes] - bioinformatics and functional genomics (Section 5 of Chapter 5 uses a comparison tool similar to blast to quickly search genomic DNA)
Implementation of double linked list in C language
Analysys analysis: online audio content consumption market analysis 2022
Final review -php learning notes 4-php custom functions
Self study notes -- use of 74h573
How to quickly delete routing in Ad
November 19, 2021 [reading notes] a summary of common problems of sneakemake (Part 2)
Examen final - notes d'apprentissage PHP 5 - Tableau PHP
深度学习——BRNN和DRNN
Three software installation methods
DXP shortcut key
342 maps covering exquisite knowledge, one of which is classic and pasted on the wall
C51 minimum system board infrared remote control LED light on and off
Minecraft 1.16.5 module development (50) guide book
C language - student achievement management system