I am trying to calculate days ago.
Date in my markdown file is written like:
fecha: 2012-12-19 00:00:00
Showing this date in front-end I have:
<%- date(post.fecha, 'dddd, MMMM Do YYYY') %>
How to make it show “237 days ago”, for example?
I am trying to calculate days ago.
Date in my markdown file is written like:
fecha: 2012-12-19 00:00:00
Showing this date in front-end I have:
<%- date(post.fecha, 'dddd, MMMM Do YYYY') %>
How to make it show “237 days ago”, for example?
Do you want to do it that it is possible to calculate also between two different time zones? Or just on one?
Because if you want over two different time zones you need to consider this:
Anyway, you may need to use UNIX time, or it becomes difficult to calculate days elapsed since then
Then yeah, the difference in UNIX time between one day and the other, converted back to days - considering that one day has 86400 seconds, or 86400000 milliseconds