I was running a textboard that has custom software. It has gone down due to reasons beyond my control (got a new router, AT&T won't let me port forward like I was able to do before). Anyways, in the event I can open ports again, I would like to add something to the script. How could I add an Eternal September post date like on DQN? Would I have to play with date()?
You probably would have to write your own date function based on PHP's date(). For example if you wanted to stay on 2000 and we have 2014 then you'd have to add (2014-2000)*12 months to your month count. But since you want an eternal september you'd have to calculate 14*12*30 days instead. It's actually really easy.
php is shit
>>4
Everything else is shit. But not quite as shit as php. php is a magnificent example of a shitty programming language. However, despite being a total pile of shit you may still achieve satori while using it. As a architectural genius may realize er abilities when stacking blocks of cow dung. After years of toiling with shit, ey will find bricks and concrete, and ey will wounder why the building blocks don't naturally stick together and emit the familiar odor.
>>5
Thank you for that depressing view on languages.
>>6
Don't take it too seriously. Everything is shit in the sense that everything is inadequate at expression in one way or another. But what formal language could possibly compare to the extent of a person's imagination? Nothing.
wouldn't you do?
`$date = Date('2003-09-d')
so that todays date (21st) would say 2003-09-21
*without the backtick. thought that would turn the line into monotype like on ascii boards
>>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.