Re: [PHP] counting with dates (help!)

2002-01-09 Thread Peter J. Schoenster
On 7 Feb 2002, at 23:21, Sander Peters wrote: > Hello, > > > This is my problem: > > $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y))); > $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(Y))); > echo ($today - $last_week); The result is a number like 8876 > (20020107-20

Re: [PHP] counting with dates (help!)

2002-01-08 Thread Henning Sprang
Sander Peters wrote: > Hello, > > > This is my problem: > > $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y))); > $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(Y))); > echo ($today - $last_week); > The result is a number like 8876 (20020107-20011231 = 8876) which i

RE: [PHP] counting with dates (help!)

2002-01-07 Thread Martin Towell
TECTED]; Martin Towell Subject: Re: [PHP] counting with dates (help!) RE: [PHP] counting with dates (help!)Hi Sander, (and Chris, and Martin) > $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y))); > $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(

Re: [PHP] counting with dates (help!)

2002-01-07 Thread DL Neil
RE: [PHP] counting with dates (help!)Hi Sander, (and Chris, and Martin) > $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y))); > $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(Y))); > echo ($today - $last_week); > The result is a number lik

Re: [PHP] counting with dates (help!)

2002-01-07 Thread Steve Cayford
Well, I'll chime in as well. I'd recommend doing all your calculations in timestamps in seconds, then convert the results into days, dates, or whatever. If you only have a date to start with then convert to a timestamp, do the calculation, and convert back. You could wrap it in a function like

RE: [PHP] counting with dates (help!)

2002-01-07 Thread Boget, Chris
> $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y))); > $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(Y))); > echo ($today - $last_week); > The result is a number like 8876 (20020107-20011231 = 8876) > But in date thinking it should be 7! No, that's the difference in tim

RE: [PHP] counting with dates (help!)

2002-01-07 Thread Martin Towell
o do it in case it crops up for me in the future sometime... Martin -Original Message- From: Sander Peters [mailto:[EMAIL PROTECTED]] Sent: Friday, February 08, 2002 9:22 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] counting with dates (help!) Hello, This is my problem:

[PHP] counting with dates (help!)

2002-01-07 Thread Sander Peters
Hello, This is my problem: $today = date("Ymd", mktime(0,0,0, date(m),date(d),date(Y))); $last_week = date("Ymd", mktime(0,0,0, date(m),date(d)-7,date(Y))); echo ($today - $last_week); The result is a number like 8876 (20020107-20011231 = 8876) But in date thinking it should be 7! How can I le