Re: Counting back 90 days...

From: Date: Mon, 05 Jan 2004 14:51:33 +0000
Subject: Re: Counting back 90 days...
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-173753@lists.php.net to get a copy of this message
Paul Chvostek wrote: > Beware timestamps, though. They usually won't work for dates before > 1970 or after 2038. If you suspect you'll need to use dates outside > that period (for example, show the 90 days of <whatever> as of some > date > in 1969), your results may be unpredictable. > > For example, strftime("%+",0) returns "Wed Dec 31 19:00:00 EST 1969" > in > my timezone, and strftime("%+",-1) returns a blank. Yet, doing a > strtotime("1969-12-31 23:59:59 GMT") will get you a -1, and the date() > function appears to support negative timestamps ... which means you > can't skimp on your testing if you decide to go this route. ;-) In Business Basic I use Julian Dates: http://www.basis-documentation.com/commands/jul_function.htm. This lets me easily calculate days between dates just by substracting integers. Why has PHP made dates more difficult? -eric wood

« previous php.general (#173753) next »