Rolling your own Date/Time functions
Submitted by phrax on Wed, 2004-11-24 15:22.
Bad Architecture
What do you do when there are just too many working hours in the day? Re-invent some PHP functions. While you're at it also add some global variable requirements to make sure free time doesn't happen in the future.
Comments are submitter's:
<?php
//all this to do a strtotime("+1 month", $time) using global vars... ewh.
function month_adv() {
Global $month, $month_adv, $num_day_adv, $month_inc_adv;
if ($month == "January") {
$month_adv = "February";
$num_day_adv = "28";
$month_inc_adv = "02";
}
if ($month == "February") {
$month_adv = "March";
$num_day_adv = "31";
$month_inc_adv = "03";
}
if ($month == "March") {
$month_adv = "April";
$num_day_adv = "30";
$month_inc_adv = "04";
}
if ($month == "April") {
$month_adv = "May";
$num_day_adv = "31";
$month_inc_adv = "05";
}
if ($month == "May") {
$month_adv = "June";
$num_day_adv = "30";
$month_inc_adv = "06";
}
if ($month == "June") {
$month_adv = "July";
$num_day_adv = "31";
$month_inc_adv = "07";
}
if ($month == "July") {
$month_adv = "August";
$num_day_adv = "31";
$month_inc_adv = "08";
}
if ($month == "August") {
$month_adv = "September";
$num_day_adv = "30";
$month_inc_adv = "09";
}
if ($month == "September") {
$month_adv = "October";
$num_day_adv = "31";
$month_inc_adv = "10";
}
if ($month == "October") {
$month_adv = "November";
$num_day_adv = "30";
$month_inc_adv = "11";
}
if ($month == "November") {
$month_adv = "December";
$num_day_adv = "31";
$month_inc_adv = "12";
}
if ($month == "December") {
$month_adv = "January";
$num_day_adv = "31";
$month_inc_adv = "01";
}
} //END Month Advance
?>