[Code Help]General code help?[PHP] (12)

11 Name: #!/usr/bin/anonymous : 2014-04-26 12:57 ID:VhMy9ojj

>>8
Days accumulate. I.e. we're on day 7543 today (september 1993).
>>9
You need to match the opening backtick with a closing backtick. On your post form, click More options..., there is an option box for Formatting:. The default is WakabaMark, see docs here http://wakaba.c3.cx/docs/docs.html#WakabaMark
>>10
$days is a constant and not a variable! I.e. it does not depend on the actual date. How can it possibly update?
You'd first need to retrieve the current date, for example 26/4/2014.
Then you calculate

#        20 years         3 months     current month
$days = (2013-1993)*365 + 3*30 + 26;

But this is a rough calculation that is not correct. The first problem is that not all months have 30 days, and the second is that not all years have 365 days.

Another way is to use the unix epoch and the function mktime. For example, (with comments for your convenience)

# set the timezone with
# date_default_timezone_set()
# if necessary
$zerotime = mktime(0, 0, 0, 9, 0, 1993); # Unix epoch of September 1993 day 1 time 00:00
$currtime = time(); # Current Unix epoch
$difftime = $currtime - $zerotime; # seconds passed since September 1993, day 1 time 00:00.
$days = $difftime / 60 / 60 / 24; # seconds to days
print "Today is September, $days 1993, the september that never ends"

That should give you an accurate date for eternal september. See http://en.wikipedia.org/wiki/Unix_time for details on Unix epoch time.

Name: Link:
Leave these fields empty (spam trap):
More options...
Verification: