当前位置:网站首页>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, '/')))
}
},
边栏推荐
猜你喜欢

冰冰学习笔记:快速排序
![December 19, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)](/img/e9/8646f3e2da0ece853e7135eb6e30d9.jpg)
December 19, 2021 [reading notes] - bioinformatics and functional genomics (Chapter 5 advanced database search)

Three software installation methods

Commands and permissions for directories and files

Processes, jobs, and services

Final review -php learning notes 9-php session control

Installation software operation manual (continuous update)

Dynamic memory management
![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)

Virtual machine VMware: due to vcruntime140 not found_ 1.dll, unable to continue code execution
随机推荐
期末复习-PHP学习笔记6-字符串处理
Analysys analysis: online audio content consumption market analysis 2022
Record the problem that the system file cannot be modified as an administrator during the development process
Investment and financing analysis report of Supply Chain & logistics industry in 2021
Xiashuo think tank: 50 planet updates reported today (including the global architects Summit Series)
PMIC power management
24C02
Dynamic memory management
Digital white paper on total cost management in chain operation industry
Introduction notes to pytorch deep learning (10) neural network convolution layer
Spring Festival inventory of Internet giants in 2022
Efga design open source framework openlane series (I) development environment construction
How to quickly delete routing in Ad
Final review -php learning notes 7-php and web page interaction
C language operators
Projection point of point on line
Permutation and combination of probability
Common sorting methods
Socket socket programming -- UDP
STM32 infrared communication 2