zoukankan      html  css  js  c++  java
  • 时间戳转换

    13位与10位时间戳转换

    filters: { //vue过滤器
      //时间戳改变
      timechange: function (value) { //13位时间戳
      var date = new Date(value);
      const Y = date.getFullYear() + '-';
      const M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
      const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + ' ';
      const h = (date.getHours() < 10 ? '0'+date.getHours() : date.getHours()) + ':';
      const m = (date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes()) + ':';
      const s = (date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds());
      return (Y+M+D+h+m+s);
    },
    
    //10位时间戳
    timechange: function (value) {
      var date = new Date(value);
      const Y = date.getFullYear() + '年';
      const M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '月';
      const D = (date.getDate() < 10 ? '0'+date.getDate() : date.getDate()) + '日';
      return (Y+M+D);
      },
    },
    
  • 相关阅读:
    jQuery选择器
    jquery处理json笔记
    观察者模式
    shiro自定义realm
    AysncTask更新progressbar
    android自定义控件
    任务的挂起和激活
    main方法添加2个集合存储图形
    矩形类-内部类刷新
    圆类-内部类多线程刷新
  • 原文地址:https://www.cnblogs.com/hellogmy/p/14481600.html
Copyright © 2011-2022 走看看