It won't always give the right answer, because not all days are 24*60*60 seconds long. It's possible for your code to return one more day or one less day than expected.
For example,
it's possible for 4:30am one day to 4:00am the next day to return 1, and
it's possible for 4:00am one day to 4:30am the next day to return 0.
In reply to Re^2: question about unix timestamps (epoch)
by ikegami
in thread question about unix timestamps (epoch)
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |