Json日期格式转换为正常格式
来源:互联网 发布:三星荣誉勋章java 编辑:程序博客网 时间:2024/04/19 18:41
<script>
function jsonDateFormat(jsonDate){
try{
var date=new Date(parseInt(jsonDate.replace("/Date(","").replace(")/",""),10));//json时间转换
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;//返回时间
}
catch(ex){
return "对不起系统出错了!!!";//错误返回
}
}
</script>
function jsonDateFormat(jsonDate){
try{
var date=new Date(parseInt(jsonDate.replace("/Date(","").replace(")/",""),10));//json时间转换
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;//返回时间
}
catch(ex){
return "对不起系统出错了!!!";//错误返回
}
}
</script>
1 0
- Json日期格式转换为正常格式
- json格式日期转换为自定义格式
- json转换日期格式
- JSON 日期格式转换
- json日期格式转换
- json日期格式转换
- json日期格式转换
- json日期格式转换
- JSON转换为JAVA对象及日期格式转换处理
- JSON转换为JAVA对象及日期格式转换处理
- Json格式日期变回正常显示
- json-lib 日期格式转换
- Json格式日期转换问题
- 转换json格式的日期为Javascript对象
- excel日期格式转换为文本格式
- 转换为英文日期格式
- 字符串转换为日期格式
- json格式数据转换为xml格式
- Nike Mercurial Victory of front not one but
- windows 系统分区表及硬盘格式
- Android 调用系统相机回调后的处理
- 八一八招聘的那些事儿
- 开博了
- Json日期格式转换为正常格式
- C语言学习笔记--C语言的环境与编译
- javascript 表单完成后才能点按钮
- 记一次惨痛的java服务器full gc.......经过
- 数组中只出现一次的数字
- sessionStorage 、localStorage 和 cookie 对比区分
- Redis学习(三)
- 解决Android Studio Gradle's dependency cache may be corrupt 错误
- android studio基本设置