博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
将json返回的日期格式转换
阅读量:6914 次
发布时间:2019-06-27

本文共 709 字,大约阅读时间需要 2 分钟。

<script>
        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();
            var hour = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
            var second = date.getSeconds() < 10 ? "0" + date.getSeconds() : date.getSeconds();
            var milions = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
            return date.getFullYear() + "-" + month + "-" + currentDate + " " + hour + ":" + second + ":" + milions;
        }

</script> 

转载于:https://www.cnblogs.com/superMay/p/4882503.html

你可能感兴趣的文章
深度优先和广度优先遍历及其 Java 实现
查看>>
CentOS6.5安装OCSNG2.1.1.1+GLPI0.85—GLPI安装(二)
查看>>
“师傅”与“师父”
查看>>
mybatis错误:[Err] 1064 - You have。。。。 the right syntax to use near 'Delete)
查看>>
Hadoop伪分布式搭建
查看>>
SSL
查看>>
mysql内置函数
查看>>
邮件发送问题
查看>>
30年分布,30年集中——高校认证计费的变革
查看>>
我的友情链接
查看>>
es中的分片查询方式
查看>>
使用Cobbler2.4.0批量自动安装Esxi5.5
查看>>
我的友情链接
查看>>
Nagios 系统监控
查看>>
Python-w3
查看>>
解决Python开发过程中依赖库打包问题的方法
查看>>
Java封装C++类的几个关键技术点
查看>>
架构设计:系统间通信(35)——被神化的ESB(下)
查看>>
unix 高级IO 文件锁
查看>>
我的友情链接
查看>>