0

I have following date and time string.

var myDateString = '17-05-2019 10:30 PM';

How can I convert it to a javascript date? I have tried to find on Google but couldn't find a solution.

3

1 Answer 1

1

Use the native js library.

new Date(myDateString)

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

1 Comment

It's working for me. I changed the date format to yyyy-mm-dd then combined the time 10:30 PM and its working fine.

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.