I'm trying to convert a ISO8601 date format (example: 2010-06-13T01:45:03Z
) to a basic, simple format such as this: "DD-MM-YYYY"
. On top of this, I want to be able to convert the ISO8601 date to the difference between the ISO date and the current date, in days. E.g. With the input of an ISO of a date 1 year ago, return 365 days. I've tried a couple libraries to help with this but im struggling to do it.
Asked
Active
Viewed 47 times
-1

Magnaboy
- 13
- 1
- 4
-
1What research have you done? If you did some, you'd notice that this question has been answered many times before. – evolutionxbox Apr 20 '17 at 15:45
-
And http://stackoverflow.com/q/492994/215552 for the date difference. As already mentioned, please do some research. I searched for your title question and got "About 322,000 results" – Heretic Monkey Apr 20 '17 at 15:48
1 Answers
0
You can use this library http://momentjs.com And as an exercise read the manual and find out how you can do it by yourself ;)

chrysanthos
- 1,388
- 10
- 17