function jsonDateFormat(jsonDate) {//json日期格式转换为正常格式
try {
var date = new Date(parseInt(jsonDate.replace("/Date(", "").replace(")/", ""), 10));
var month = date.getMonth() + 1 < 10 ? "0" + (date.getMonth() + 1) : date.getMonth() + 1;
var day = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
var hours = date.getHours();
var minutes = date.getMinutes();
var seconds = date.getSeconds();
var milliseconds = date.getMilliseconds();
return date.getFullYear() + "-" + month + "-" + day;
//+ " " + hours + ":" + minutes + ":" + seconds + "." + milliseconds;
} catch (ex) {
return "";
}
}

出自http://www.cnblogs.com/ahjesus

json时间格式化问题的更多相关文章

  1. Newtonsoft.Json 时间格式化

    时间序列化经常多个T:“2017-01-23T00:00:00” 解决方案: 日期格式化输出,指定IsoDateTimeConverter的DateTimeFormat即可 IsoDateTimeCo ...

  2. json时间格式化

    //格式化日期字符串 String.prototype.jsonDateFormat = function (format) { var date, timestamp, dtObj timestam ...

  3. C# DataTable转json 时间格式化

    1.NewTonSoft.json public static string DataTableToJson(DataTable dt) { ) { return ""; } el ...

  4. JSON时间转换格式化

    通常JSON时间一般是这样的格式. 1 /Date(1436595149269)/ 通常我们用AJAX获取下来的JSON数据,如果有时间,都是这种格式的.其中,中间的一段数字"1436595 ...

  5. [.Net Core 3.0+/.Net 5] System.Text.Json中时间格式化

    简介 .Net Core 3.0开始全新推出了一个名为System.Text.Json的Json解析库,用于序列化和反序列化Json,此库的设计是为了取代Json.Net(Newtonsoft.Jso ...

  6. 表单序列化json字符串和js时间格式化

    js时间格式化 new Date().format("时间格式") Date.prototype.format = function(fmt) { var o = {        ...

  7. EasyUI Datagrid Datetime(EasyUI DataGrid 时间格式化)

    EasyUI DataGrid 时间格式化 方法一: var Common = { //EasyUI用DataGrid用日期格式化 TimeFormatter: function (value, re ...

  8. JSon 事件格式化

    JS~json日期格式化   起因 对于从C#返回的日期字段,当进行JSON序列化后,在前台JS里显示的并不是真正的日期,需要格式化时间 实现 function ChangeDateFormat(js ...

  9. Javascript 金额、时间格式化

    一晃2017年已经过去了,2018年已经悄然而至.回首过去的2017年,工作还是一如既往,但生活却有了翻天覆地的变化.尚还觉得自己还小的自己,在过去的一年中却完成了两件人生大事,回想起来还是一脸懵逼, ...

随机推荐

  1. 使用rdesktop连接Windows远程桌面

    rdesktop 使用简单,windows也不和装什么服务端,是要把远程桌面共享打开就行了 安装 yum -y install rdesktop 具体使用方法要先打开终端,然后输入以下命令: rdes ...

  2. IOS - UIViewController的生命周期

    1)Load周期 2)Unload周期 在UIViewController中,view(黑体的view指的是controller的view属性)有两个循环:加载和卸载循环.当程序的一部分向contro ...

  3. IOS- 内存管理机制

    iOS平台内存常见问题 作为iOS平台的开发者,是否曾经为内存问题而苦恼过?内存莫名的持续增长,程序莫名的crash,难以发现 的内存泄漏,这些都是iOS平台内存相关的常见问题:本文将会详细介绍iOS ...

  4. Spetember 5th 2016 Week 37th Monday

    No matter how far you may fly, never forget where you come from. 无论你能飞多远,都别忘了你来自何方. Stay true to you ...

  5. python基础——使用@property

    python基础——使用@property 在绑定属性时,如果我们直接把属性暴露出去,虽然写起来很简单,但是,没办法检查参数,导致可以把成绩随便改: s = Student() s.score = 9 ...

  6. HTML5 – 2.新元素

    figcaption 定义和用法 <figcaption> 标签定义 figure 元素的标题(caption). "figcaption" 元素应该被置于 " ...

  7. 《Linux私房菜》笔记和问题记录

    鸟哥的Linux私房菜简体首页 对Linux的学习侧重于基本命令和运维相关的部分,最后章节的测试问题不错. 1.VIM程序编辑器 1.所有的Linux都会内建VI:很多软件的编辑接口都会主动呼叫VI: ...

  8. vim、gvim加载文件慢

    1. strace -f -T -o vim.strace vim 2. vim --startuptime "vim-time.txt" 3. gvim -f

  9. poj 1611:The Suspects(并查集,经典题)

    The Suspects Time Limit: 1000MS   Memory Limit: 20000K Total Submissions: 21472   Accepted: 10393 De ...

  10. 【openGL】关于画点

    #include "stdafx.h" #include <GL/glut.h> #include <stdlib.h> #include <math ...