I'm currently pulling data from an API, and get returned a date/time in a string in the below format:
2020-08-27T13:26:11.983Z
I'm guessing the string can be separated as such:
Date: 2020-08-27
Time: T13:26:11.983Z
Though I'm not sure where the T
and Z
come into play?
How would I go about calculating the difference between the above string value and the current date/time?
The intended end result would be rendered in my React component as:
"x
Hour/s y
Minute/s ago"
Thanks so much in advance for your help everyone!