You'll need to use Julian format (I think that the name for it) which is
YYYYDDD - YYYY is the year and DDD is the number of days into the year. I'm
unsure as to how to do this in PHP so you'll need to do some searching -
unless someone knows... Would be nice to know exactly how to do it in case
it crops up for me in the future sometime...


-----Original Message-----
From: Sander Peters [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 08, 2002 9:22 AM
Subject: [PHP] counting with dates (help!)


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 let php count in real days/month/years in stead of numbers?

Maybe this is a silly question, but anyone who has the answer would help
me very much!

Thanks in advance!

Met vriendelijke groet / With Greetings,

Sander Peters

  email: mailto:[EMAIL PROTECTED]
webmail: mailto:[EMAIL PROTECTED]

PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to