Date.prototype.format = function (format) {
var o = {
"M+": this.getMonth() + 1, //month
"d+": this.getDate(), //day
"h+": this.getHours(), //hour
"m+": this.getMinutes(), //minute
"s+": this.getSeconds(), //second
"q+": Math.floor((this.getMonth() + 3) / 3), //quarter
"S": this.getMilliseconds() //millisecond
}
if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
(this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o) if (new RegExp("(" + k + ")").test(format))
format = format.replace(RegExp.$1,
RegExp.$1.length == 1 ? o[k] :
("00" + o[k]).substr(("" + o[k]).length));
return format;
} function DateTimeFormatter(value) {
if (value == undefined) {
return "";
}
/*json格式时间转js时间格式*/
value = value.substr(1, value.length - 2);
var obj = eval('(' + "{Date: new " + value + "}" + ')');
var dateValue = obj["Date"];
if (dateValue.getFullYear() < 1900) {
return "";
}
//return dateValue
return dateValue.format("yyyy-MM-dd hh:mm:ss");
}

最新文章

  1. oracle基础学习
  2. CentOS7 监控进程网络流量工具安装
  3. LeetCode-Subsets
  4. C# 使用AutoResetEvent进行线程同步
  5. codeforces #305 div1 done
  6. (转)原子操作 Interlocked系列函数
  7. ZOJ 3430 Detect the Virus(AC自动机)
  8. JavaEE SSH集成框架(两) struts2 本地加载dtd文件,action组态
  9. js检测数据类型的方法你都掌握了几个?
  10. XML的序列化(Serializer)
  11. ATL编程初级教程(图文事例)(VC6)
  12. 运用scrollPic插件的实例
  13. Docker 入门到实践(三)Docker 安装
  14. js中使用将json数组 转换为json将一个包含对象的数组用以创建一个包含新重新格式化对象的新数组
  15. bugku的一道图片隐写
  16. 监听器&amp;上传下载&amp;I18N
  17. zabbix--3.0--1
  18. redis学习(六)redis管道
  19. WmS具体解释(二)之怎样理解Window和窗体的关系?基于Android7.0源代码
  20. python之列表【list】

热门文章

  1. Elasticsearch 系列1 --- Windows10安装Elasticsearch
  2. 用光的微粒说和广义相对论来解释衍射现象 Explanation of Diffraction Phenomenon by Particle Theory of Light and General Relativity
  3. 不合法的DB Index
  4. 一场关于 .net core 和 .net framework 编码的案情分析
  5. Ef-Code-First 使用实体类映射出数据库
  6. [学习笔记]K-D Tree
  7. D14——C语言基础学PYTHON
  8. SpringBoot配置文件application.properties详解
  9. Linux在终端和控制台下复制粘贴命令快捷键
  10. 一段奇妙的vim编辑器之旅