2
I would like to get how many hours has passed, from a given date, to the current date. For example:
day = "Thu May 19 2016 05:00:00 GMT-0300 (BRT)";
today = "tue May 23 2016 09:00:00 GMT-0300 (BRT)";
Variable day
has the initial date, from that date I would like to start counting the hours. And the variable today
has the current date.
That way, it takes the days, not the hours right ? Because in the example I put, the result is 3 days and 20hs, then 92hs
– Jonathan
+1 by using abs to ensure there will be no "negative" time difference. Now, Jonathan is right... removing the division by 24 at the end of the code will make him return the time, as the question asks.
– Oralista de Sistemas
I’ve changed it and it’s working, it’s hours, minutes and seconds apart.
– Pedro Luzio