zoukankan      html  css  js  c++  java
  • 日期过滤器-时间戳

    // 过滤器时间戳转换为时间 获取当前时间的时间戳:var timestamp=new Date().getTime()
    filters: {
    formatDate: function (value) {
    let date = new Date(value);
    let y = date.getFullYear();
    let MM = date.getMonth() + 1;
    MM = MM < 10 ? ('0' + MM) : MM;
    let d = date.getDate();
    d = d < 10 ? ('0' + d) : d;
    let h = date.getHours();
    h = h < 10 ? ('0' + h) : h;
    let m = date.getMinutes();
    m = m < 10 ? ('0' + m) : m;
    let s = date.getSeconds();
    s = s < 10 ? ('0' + s) : s;
    return y + '.' + MM + '.' + d + ' ' + h + ':' + m;
    }
    },
     
    <label>{{ lists.createTime | formatDate}}</label>
     
    lists:[
    {
    colName: `附件标题附件标题附件标题`,
    fujian:'',
    createTime: 1566363884862,
    },
    {
    colName: '附件标题附件标题附件标题.doc',
    fujian:'',
    createTime: 1566363884862,
    },
    {
    colName: '附件标题附件标题.pdf',
    fujian:'',
    createTime: 1566363884862,
    },
    ]
  • 相关阅读:
    MVC6 发布IIS
    Spring-Spring Bean后置处理器
    Java中重载和重写
    Java基础
    Python高级教程-多重继承
    Spring Bean声明周期
    Spring Bean作用域
    Spring-ApplicationContext容器
    Spring-BeanFactory容器
    Spring-Spring IoC容器
  • 原文地址:https://www.cnblogs.com/shababy/p/11408748.html
Copyright © 2011-2022 走看看