How to format a JSON date? Problems with Json Date ?
jsonDate :
/Date(1224043200000)/
Solution :
var date = new Date(parseInt(jsonDate.substr(6)));
var date = new Date(parseInt(jsonDate.substr(6)));
The substr function takes out the "\/Date(" part, and the parseInt function gets the integer and ignores the ")\/" at the end. The resulting number is passed into the Date constructor.
Cheers !
Hope you got the Ans !
still having probs ? let me know by comments !
Know More About :
PHP Freelancing India



Great post! Our google cloud training
ReplyDeletehelps learners build practical skills in cloud computing using Google Cloud Platform services like Compute Engine, Cloud Storage, BigQuery, Dataflow, and Pub/Sub. It is job-oriented with hands-on labs and real-world projects, helping students and professionals improve productivity and build strong career opportunities in cloud and IT roles.