当前位置:网站首页>时间戳转格式化日期
时间戳转格式化日期
2022-04-23 05:52:00 【三笑痴513】
定义一个全局过滤器:
Vue.filter('dataFormat',function(originVal){
const dt = new Date(originVal)
const y = dt.getFullYear()
const m = (dt.getMonth() + 1 + '').padStart(2,'0')
const d = (dt.getDate() + '').padStart(2,'0')
const hh = (dt.getHours() + '').padStart(2,'0')
const mm = (dt.getMinutes() + '').padStart(2,'0')
const ss = (dt.getSeconds() + '').padStart(2,'0')
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
版权声明
本文为[三笑痴513]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_60248719/article/details/120689478
边栏推荐
- The waterfall waterfall flow of uview realizes single column and loads more
- [UDS unified diagnosis service] i. diagnosis overview (3) - ISO 15765 architecture
- C语言实用小技巧合集(持续更新)
- [ThreadX] h743zi + lan8720 + ThreadX + netx duo transplantation
- C语言代码规范
- 猜數字遊戲
- [opencv] use filestorage to read and write eigenvectors
- C语言数组处理批量数据
- SDOI2009-HH的项链
- Palindromic Primes
猜你喜欢
随机推荐
Qt 添加QSerialPort类 实现串口操作
拷贝构造函数
QT icon application
SDOI2009-HH的项链
SSH 公钥 私钥的理解
Vscode custom comments
Shell脚本的通配符和特殊符号
【UDS统一诊断服务】(补充)五、ECU bootloader开发要点详解 (1)
软件工程中的十三种文档
LaTeX配置与使用
类的继承与派生
Vs can be compiled, but there will be a red underline to indicate the problem of undefined identifiers
搭建jpress个人博客
生成快捷方式
FOC电机库 定点PID代码分析
带默认模板实参的类模板与模板模板形参的匹配
Notes on advanced points of C language 5
【UDS统一诊断服务】三、应用层协议(2)
POJ-The Unique MST
copy constructor