Re: [PHP] Counting back 90 days...

2004-01-05 Thread Paul Chvostek
On Mon, Jan 05, 2004 at 09:51:33AM -0500, Eric Wood wrote: > > 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? Unix t

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Eric Wood
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 as of some > date > in 1969), your results may be unpredictable. > > For example, strft

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Paul Chvostek
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 +, [EMAIL PROTECTED] wrote: > > My word..

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Tristan . Pretty
My word... 6 odd lines, to one... you're a genius... Cheers for that... Tris... Richard Davey <[EMAIL PROTECTED]> 05/01/2004 11:45 Please respond to Richard Davey <[EMAIL PROTECTED]> To [EMAIL PROTECTED] cc "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> Subjec

RE: [PHP] Counting back 90 days...

2004-01-05 Thread Jami
Easier way to do that is like so: $archive_date = date("Y-m-d", (time()-(86400*90))); I use this same kind of calculation for getting a date in the future. 86400 is the number of seconds in a day. Time returns the Unix Timestamp, just like you would get with mktime(). Makes for a lot less code an

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Jon Haworth
Hi Tris, > But is there an easy was to calculate 90 days > from the timestamp... There are 86400 seconds in a day... can't you just do something like: $timestamp -= (86400 * 90); Or even $timestamp -= 7776000; // 90 days Cheers Jon -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Counting back 90 days...

2004-01-05 Thread Richard Davey
Hello Tristan, Monday, January 5, 2004, 11:29:16 AM, you wrote: TPrsc> But is there an easy was to calculate 90 days from the timestamp... 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"));