in reply to Re: question about unix timestamps (epoch)
in thread question about unix timestamps (epoch)

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.

  • Comment on Re^2: question about unix timestamps (epoch)

Replies are listed 'Best First'.
Re^3: question about unix timestamps (epoch)
by johnlawrence (Monk) on Sep 13, 2007 at 14:25 UTC
    That's a good point. I was just about to ask why when I realised the obvious! I guess the solution I gave, was more "the number of 24 hour periods". Still, that should work in most cases, I guess it depends how critical it is.