0

I'm trying to convert a date string to date format, something like this:

var date = "07/11/2015"; //format is mm/dd/yyyy

Now I want it to be in this format:

date = Tue Sep 01 2015 00:00:00 GMT+0530 (India Standard Time)

Can anyone suggest a way to achieve it. Thanks in advance!

4
  • Read this stackoverflow.com/questions/15993913/format-date-with-moment-js Commented Sep 1, 2015 at 10:36
  • @Manwal, that's for converting to 'mm/dd/yyyy' format? Can you please suggest how to do it's reverse. Commented Sep 1, 2015 at 10:39
  • You can convert to any format with Moment. Commented Sep 1, 2015 at 10:40
  • @Manwal: Not as many as your could implement natively on your own ;-) Commented Sep 1, 2015 at 10:42

1 Answer 1

3

var date = "07/11/2015";
    
alert(new Date(date)); //Sat Jul 11 2015 00:00:00 GMT+0530 (India Standard Time)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.