I’m working on JavaScript and stuck in a small issue.
I am receiving this date in JSON response 1322919399447-0500
and I want to format this like: 6:50 PM, Dec 3rd 2011.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not sure if this is the best way (I’m sure it’s not, actually), but essentially you can make that datestring into a js Date object, then pull out the pieces to manipulate as you see fit:
Then you can concatenate those pieces into your own format. Like I said, there’s probably a better way, but this works in a pinch.