zoukankan      html  css  js  c++  java
  • 在html中反序列化日期数据格式

     //序列号是不支持日期格式的  要转换
            function ChangeDateFormat(jsondate) {
                jsondate = jsondate.replace("/Date(", "").replace(")/", "");
                if (jsondate.indexOf("+") > 0) {
                    jsondate = jsondate.substring(0, jsondate.indexOf("+"));
                }
                else if (jsondate.indexOf("-") > 0) {
                    jsondate = jsondate.substring(0, jsondate.indexOf("-"));
                }

                var date = new Date(parseInt(jsondate, 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;
            }

  • 相关阅读:
    MySQL用户管理
    MySQL函数
    MySQL数据类型
    MySQL配置
    PowerDesigner之PDM检查
    PowerDesigner之PDM(物理概念模型)
    .NET Reflector反编译的方法
    IBatis.net 输出SQL语句(七)
    SVN 记录冲突、忽略
    SQLServer 窗口函数
  • 原文地址:https://www.cnblogs.com/q101301/p/3655819.html
Copyright © 2011-2022 走看看