Reputation: 3
What does these two lines do?
Math.floor(1293859512411 / 86400000)
Math.ceil((new Date().getTime()) / 86400000)
I understand it is something to do with time since epoch, but please explain the two lines.
Upvotes: 0
Views: 75
Reputation: 1499860
Well, 86400000 is the number of milliseconds in a day - so
Math.ceil((new Date().getTime()) / 86400000)
is meant to be "the number of days elapsed since the Unix epoch at January 1st 1970 midnight UTC, rounding up".
The first line just returns the number of days between the Unix epoch and January 5th 2011.
Upvotes: 3