第一种方法

/Date(1555554794000)/ 转换为 2019/4/18

new Date(parseInt('/Date(1555554794000)/'.substr(6, 13))).toLocaleDateString();

/Date(1555554794000)/ 转换为 2019/4/18 上午10:33:14

new Date(parseInt('/Date(1555554794000)/'.substr(6, 13))).toLocaleString()

/Date(1555554794000)/ 转换为 上午10:33:14

new Date(parseInt('/Date(1555554794000)/'.substr(6, 13))).toLocaleTimeString()

第二种方法

//日期格式化
function ChangeDateFormat(jsondate) {
jsondate = jsondate.replace("/Date(", "").replace(")/", "");
if (jsondate.indexOf("+") > 0) {
jsondate = jsondate.substring(0, jsondate.indexOf("+"));
}
else if (jsondate.indexOf("-") > 0) {
jsondate = jsondate.substring(0, jsondate.indexOf("-"));
}
var date = new Date(parseInt(jsondate, 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 hours = date.getHours() < 10 ? "0" + date.getHours() : date.getHours();
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
var second = date.getMilliseconds() / 1000 < 10 ? "0" + parseInt(date.getMilliseconds() / 1000) : parseInt(date.getMilliseconds() / 1000);
return date.getFullYear() + "-" + month + "-" + currentDate + " " + hours + ":" + minutes + ":" + second;
};

/Date(1555554794000)/ 转换为日期格式的更多相关文章

  1. mysql内置函数,在mysql里面利用str_to_date()把字符串转换为日期格式

    mysql内置函数,在mysql里面利用str_to_date()把字符串转换为日期格式 示例:分隔符一致,年月日要用%号 select str_to_date('2008-4-2 15:3:28', ...

  2. 使用ParseExact方法将字符串转换为日期格式

    实现效果: 知识运用: DateTime结构的ParseExact方法 public static DateTime ParseExact(string s,string format,IFormat ...

  3. Date 当前程序日期格式 参数设置 DecimalSeparator

    日期格式.货币格式等 Date DateFormat DecimalSeparator FormatSettings FormatSettings.DateSeparator='-'; 控制面板的日期 ...

  4. JavaScript前端将时间戳转换为日期格式

    function (data) { var date = new Date(data) var Y = date.getFullYear() + '-' var M = (date.getMonth( ...

  5. Date类与日期格式

    Date类概述: 表示特定的瞬间,精确到毫秒. Date()分配 Date 对象并初始化此对象,以表示分配它的时间(精确到毫秒).Date(long date)分配 Date 对象并初始化此对象,以表 ...

  6. JSON Date Format/JSON 日期格式方法分享

    我是很懒的,不想多说,所以直接上代码.亲们懂的. <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://w ...

  7. jstl long类型数据转换为日期格式

    一.有WEB-INF下建立一个datetag.tld <?xml version="1.0" encoding="UTF-8"?> <tagl ...

  8. vue 获取时间戳对象转换为日期格式

    //1. 简单页面展示用<template> <!-- time为时间戳 --> <div>{{time | formatDate}}</div> &l ...

  9. js 时间戳转换为日期格式

     //将1525854409000类型的时间转换成“yyyy-MM-dd”或“yyyy-MM-dd hh:mm:ss”   //info.birthday是后台获取到的Date类型的出生日期数据, / ...

随机推荐

  1. Docker进阶之四:centos7安装docker

    centos7.6 安装docker 参考:https://docs.docker.com/install/linux/docker-ce/centos/ 一.存在老版本先删除 yum remove ...

  2. OpenXMl倒出word、PDF

    OpenXMl倒出word.PDF @using MarkdownSharp @{     ViewBag.Title = "预览";     Layout = "~/V ...

  3. MyBatis基本要素---核心配置文件

    今天就简单的叙述下MyBatis的核心配置文件吧~~ configuration  配置 properties  可以配置在java属性配置文件中 settings   修改Mybatis在运行时的行 ...

  4. Spring MVC的文件上传和下载

    简介: Spring MVC为文件上传提供了直接的支持,这种支持使用即插即用的MultipartResolver实现的.Spring MVC 使用Apache Commons FileUpload技术 ...

  5. es6 proxy代理

    es6 新增构造函数 Proxy Proxy 构造函数,可以使用new 去创建,可以往里面插入两个参数,都是对象 let target = {} let handler = {} let proxy ...

  6. MySQL安装之yum安装

    转载来源:https://www.cnblogs.com/brianzhu/p/8575243.html 1. 下载并安装MySQL官方的 Yum Repository 1 [root@BrianZh ...

  7. Status bar could not find cached time string image. Rendering in-process?

    在开发中,控制台经常输出“Status bar could not find cached time string image. Rendering in-process?” 在 Info.plist ...

  8. 一天一个Linux命令--nmcli

    nmcli命令连接和删除SSID nmcli d wifi                                                                        ...

  9. ERROR:"org.apache.zookeeper.KeeperException$NoAuthException: KeeperErrorCode = NoAuth for /config/topics/test" when creating or deleting Kafka operations authorized through the Ranger policies

    PROBLEM DESCRIPTION When creating or deleting topics in Kafka, they cannot be authorized through the ...

  10. linux 软链接的创建、删除和更新

    大家都知道,有的时候,我们为了省下空间,都会使用链接的方式来进行引用操作.同样的,在系统级别也有.在Windows系列中,我们称其为快捷方式,在Linux中我们称其为链接(基本上都差不多了,其中可能有 ...