当前位置:网站首页>Timestamp to formatted date
Timestamp to formatted date
2022-04-23 17:47:00 【Sanxiaochi 513】
Define a global filter :
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}`
})
版权声明
本文为[Sanxiaochi 513]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230550325391.html
边栏推荐
- Sword finger offer 03 Duplicate number in array
- Future 用法详解
- PC电脑使用无线网卡连接上手机热点,为什么不能上网
- Leak detection and vacancy filling (6)
- 102. 二叉树的层序遍历
- 31. Next arrangement
- Leak detection and vacancy filling (VIII)
- JS forms the items with the same name in the array object into the same array according to the name
- Comparison between xtask and kotlin coroutine
- 239. 滑动窗口最大值(困难)-单向队列、大顶堆-字节跳动高频题
猜你喜欢
Gaode map search, drag and drop query address
Halo open source project learning (II): entity classes and data tables
嵌入式系统中,FLASH中的程序代码必须搬到RAM中运行吗?
Open source key component multi_ Button use, including test engineering
PC uses wireless network card to connect to mobile phone hotspot. Why can't you surf the Internet
Exercise: even sum, threshold segmentation and difference (two basic questions of list object)
Detailed deployment of flask project
Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
Future 用法详解
394. 字符串解码-辅助栈
随机推荐
SystemVerilog (VI) - variable
92. 反转链表 II-字节跳动高频题
JVM类加载机制
Qt error: /usr/bin/ld: cannot find -lGL: No such file or directory
Commonly used functions -- spineros:: and spineros::)
The method of changing a value in the array and a value in the object of wechat applet
958. Complete binary tree test
超分之TDAN
Gaode map search, drag and drop query address
Qt 修改UI没有生效
Open source key component multi_ Button use, including test engineering
How to use the input table one-way service to send (occupy less) picture files (body transmission)? FileReader built-in object involved
JS parsing and execution process
開期貨,開戶雲安全還是相信期貨公司的軟件?
【Appium】通过设计关键字驱动文件来编写脚本
[二叉数] 二叉树的最大深度+N叉树的最大深度
Some questions some questions some questions some questions
Double pointer advanced -- leetcode title -- container with the most water
Future usage details
Use of five routing guards