zoukankan      html  css  js  c++  java
  • JSON ISODate MVC Datetime

    $().ready(function() {
        $('#datepicker').datepicker({
            inline: true
        });
        @RenderSection("jsStartUp",false)
    });
    Date.prototype.toISOString = function() {
        //var date = '"\\\/Date(' + this.getTime() + ')\\\/"';
        return toISOString(this);
    };
    function padzero(n) {
            return n < 10 ? '0' + n : n;
    }

     function pad2zeros(n) {
         if (n < 100) {
             n = '0' + n;
         }
         if (n < 10) {
             n = '0' + n;
         }
         return n;     
     }
     function toISOString(d) {
         return d.getUTCFullYear() + '-' +  padzero(d.getUTCMonth() + 1) + '-' + padzero(d.getUTCDate()) + 'T' + padzero(d.getUTCHours()) + ':' +  padzero(d.getUTCMinutes()) + ':' + padzero(d.getUTCSeconds()) + '.' + pad2zeros(d.getUTCMilliseconds()) + 'Z';
     }

    function parseMSJSONString(data) {
        try {
            var newdata = data.replace(
                new RegExp('"\\\\\/Date\\\((-?[0-9]+)\\\)\\\\\/"', "g"), "new Date($1)");
            newdata = eval('(' + newdata + ')');
            return newdata;
        } catch(e) {
            return null;
        }
  • 相关阅读:
    jprofiler监控分析
    实现loadrunner的IP欺骗
    dump内存和线程栈
    jprofiler监控tomcat
    nginx+tomcat负载均衡搭建及梦林博客http://www.limlhome.cn/blog/?p=298
    jconsole和jvisualvm监控tomcat配置
    apache+tomcat实现session共享
    性能测试流程
    AcWing101 最高的牛 (差分)
    AcWing100 增减序列 (差分)
  • 原文地址:https://www.cnblogs.com/jinzhao/p/2343709.html
Copyright © 2011-2022 走看看