Richard Davey <[EMAIL PROTECTED]> 05/01/2004 11:45:
> 
> Based on the current time:
> $previous_90_days_timestamp = strtotime ("-90 day");
> All in one:
> $previous_90_days_date = date("Y-m-d", strtotime("-90 day"));

On Mon, Jan 05, 2004 at 11:55:36AM +0000, [EMAIL PROTECTED] wrote:
> 
> My word...
> 6 odd lines, to one...

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.  ;-)

-- 
  Paul Chvostek                                             <[EMAIL PROTECTED]>
  it.canada                                            http://www.it.ca/
  Free PHP web hosting!                            http://www.it.ca/web/

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

Reply via email to