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[2]: [PHP] Counting back 90 days...

2004-01-05 Thread Richard Davey
Hello Paul, Monday, January 5, 2004, 2:26:16 PM, you wrote: PC> For example, strftime("%+",0) returns "Wed Dec 31 19:00:00 EST 1969" in PC> my timezone, and strftime("%+",-1) returns a blank. Yet, doing a PC> strtotime("1969-12-31 23:59:59 GMT") will get you a -1, and the date() PC> function app

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[2]: [PHP] Counting back 90 days...

2004-01-05 Thread Richard Davey
Hello Tristan, Monday, January 5, 2004, 11:55:36 AM, you wrote: TPrsc> My word... TPrsc> 6 odd lines, to one... TPrsc> you're a genius... TPrsc> Cheers for that... Glad to help. I too have spent ages messing with mktime and min/sec additions, etc - but strtotime() does it all for you. There are

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

[PHP] Counting back 90 days...

2004-01-05 Thread Tristan . Pretty
Got this function... I wanna remove 90 days from todays date, giving a final date, in the same format as the original, that counts back 90 days... I'm listing dates on a reporting tool, and I've been asked to only show info that we recieved in the last 90 days... Anyhoo... I believe I can minus 1