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
0 comments:
Post a Comment
Any Questions or Suggestions ?