标签云

微信群

扫码加入我们

WeChat QR Code

Possible Duplicate:How to format a JSON date?Parsing Date from webserviceSorry if this question has already been asked. I have look around but have been unable to find one. Is there a quick and convenient way to convert a "json" date into a human friendly format using only javascript and jQuery (excluding additional jQuerylibraries)?The date is format is the following:creationDate: "/Date(1346713200000+0100)/"Thanks


there's no such thing as a json date. You'll need to just strip out the additional non-digit (except +) chars and create a date in javascript. See this question for help: stackoverflow.com/questions/11024367/…

2019年07月24日38分58秒

cant you just do: var d=new Date(1346713200000+0100);?

2019年07月24日38分58秒

yep >var d = new Date(1346713200000+0100) >d Mon Sep 03 2012 19:00:00 GMT-0400 (Eastern Daylight Time)

2019年07月24日38分58秒

Ahren: Is it not a given that "json" date was meant as a Javascript date? (Acronym.. JSON!).. I am just curious, what would you call it?

2019年07月24日38分58秒