Home > Web Front-end > JS Tutorial > Function to convert date in json format into Javascript object_javascript skills

Function to convert date in json format into Javascript object_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 18:23:26
Original
1011 people have browsed it
Copy code The code is as follows:

//Convert the date in json format (such as: {ServerDatetime:"/ Date(1278930470649)/"}) is the date object of Javascript
function ConvertJSONDateToJSDateObject(JSONDateString) {
var date = new Date(parseInt(JSONDateString.replace("/Date(", "").replace(" )/", ""), 10));
return date;
}
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
Backslash present in Json
From 1970-01-01 08:00:00
0
0
0
Get: Transfer JSON data
From 1970-01-01 08:00:00
0
0
0
mysql storage json error
From 1970-01-01 08:00:00
0
0
0
javascript - Problems with displaying json data
From 1970-01-01 08:00:00
0
0
0
Find matching integers in JSON.
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template