Time to celebrate.
So to celebrate this day, I created a universal function, which tells you the time that has passed from any moment in the past till the present moment.
Here we go. Let’s create a function, which would take any Date as an argument and return us the information on how long ago it happened:
As an additional feature, I’d like to change the Date output into European format so it is presented as dd.mm.yy hh:mm:
Now, to check the result, let’s alert the following cases:
You may try it live at JSFiddle or by clicking “Results” below: