标签:class filter let ber second match day script 日志格式
vue毫秒日期格式化
import Vue from ‘vue‘ // 2016-12-12 16:30:00 => 16:30:00 Vue.filter(‘timeFormat‘, { read: function (val) { var number = val.match(/\d{1,2}:\d{1,2}:\d{1,2}/i).toString() return number } }) // 2016-12-12 16:30:00 => 16:30:00 Vue.filter(‘timeFormat‘, { read: function (val) { let number = new Date(val), year=number.getFullYear(), month=number.getMonth(), day=number.getDate(), hour=number.getHours(), minutes=number.getMinutes(), seconds=number.getSeconds(); return `${year}-${month}-${day} ${hour}:${minutes}:${secondes}`; })
微信小程序中使用官方例子里的format
util.formatTime(new Date)
标签:class filter let ber second match day script 日志格式
原文地址:https://www.cnblogs.com/yiyitong/p/9884941.html