Given input like "Tue Aug 30 2011 11:47:14 GMT-0300", I would like output like "MMM DD YYYY hh:mm".
What is an easy way to do it in JavaScript?
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.
Via JS, you can try converting it to a date object and then extract the relevant bits and use them:
To ease it off, you can use a library like date-js
Via regex:
/[a-zA-Z]{3} ([a-zA-Z]{3} \d{2} \d{4} \d{2}:\d{2})/should do the trick.