Page 1 of 1
Date question.
Posted: Sun Oct 06, 2002 9:46 pm
by $0.05$
How would i find out the number of days since... any given year?
IE. the number of days that have passed since 1900.
Posted: Sun Oct 06, 2002 9:55 pm
by Coco
try the date functions...
http://www.php.net/manual/en/function.date.php
(you can supply it the current timestamp, with an offset to make it right to be from whatever time you want it to be...
as to the exact numbers i couldnt tell you, but i think that the manual should help (you can use recursive date functions
:
date(mktime(date(......))) ) )
Posted: Sun Oct 06, 2002 9:58 pm
by hob_goblin
uhm... simple math..
Code: Select all
$year = date("Y");
$year = $year - 1900;
$final = $year * 365.25;
echo $final;
Posted: Sat Oct 12, 2002 9:32 pm
by qads
um...this will sound idiotic but why did u you use 365.25?

Posted: Sat Oct 12, 2002 10:45 pm
by mydimension
qads, because that's how many days are really in a year. however, just try making a calendar to accomadate that. so we round down to 365 days in a year. but over time this would really mess us up so every four years we add an extra day (leap year) to make up for the round down (.25+.25+.25+.25 = 1). i could go on forever about this but i hope that answers your question
Posted: Sat Oct 12, 2002 11:14 pm
by hob_goblin
there 365 1/4 days in a true year, but we just round down, and put an extra day on every four years..
Posted: Sun Oct 13, 2002 2:45 am
by Takuma
Basic Science...
Posted: Sun Oct 13, 2002 8:19 am
by qads
i see

....thanks guys.