zoukankan      html  css  js  c++  java
  • Js序列化时间

     
     var time = "/Date(1279270720000+0800)/";
     var tme1 = ChangeDateFormat(time);
     alert(tme1);
    image
    JS方法为:
     
    function ChangeDateFormat(cellval) {
        var date = new Date(parseInt(cellval.replace("/Date(", "").replace(")/", ""), 10));
        var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
        var currentDate = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
        return date.getFullYear() + "-" + month + "-" + currentDate;
    }
  • 相关阅读:
    解决ios手机页面overflow scroll滑动很卡的问题
    响应式网页设计:rem、em设置网页字体大小自适应
    linq 和lambda查询
    单元测试的学习
    各种仓储模式的学习
    ref 微软官网
    泛型 学习
    aop 和castle 的一些 学习文章
    autofac 的好博文
    json 序列化和反序列化的3个方法
  • 原文地址:https://www.cnblogs.com/automation/p/2954599.html
Copyright © 2011-2022 走看看