0

I have a date format like 2015-12-07T02:45:00.000Z but want to convert it to like Nove 12 , 2015 4:30 PM or 3 minuts ago accordingly

2 Answers 2

2

You can use a library called moment.js. And use moment().format('MMMM Do YYYY, h:mm a') to convert to your format or moment().startOf('hour').fromNow() to print out relative time.

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

Comments

0

Have you looked at moment.js? It has relative conversions which seem to be what you are looking for.

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.