Re: Date problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Satyam wrote:
Timestamps are stored as seconds from a certain date. The base date differ depending on the platform, Windows use 1/1/1980 the rest 1/1/1970, but still seconds. 7 days are 7*24*60*60. Just add that much to a timestamp. It helps having a constant such as:

define ('DAY_IN_SECONDS',86400);

The problem with doing it this way is that it won't take leap seconds, leap years and daylight savings into account, so on any of these edge cases it will appear to be broken. That's why strtotime("+7 days") is the correct way to do this.

-Rasmus

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux