Forum Moderators: coopster
Any help would be greatly appreciated, I am REALLY stuck on this one.
Date/Time of posting is being inserted using this method:
$timezone = +10; // Australian time <input type="hidden" name="date" value="<? print gmdate("Y/m/d @ H:i:s", time() + 3600*($timezone+date("I")));?>"> $date is then inserted into the 'date_reg' column of the DB.
Ok, what I am having problems with is how to get an expiry date into the correct timezone format (+10)to place into the expiry_date column.
I have been trying everything with not much success. I have tried something like this:
$addDays = 5; // or any number of days you want to add up to 28 you'll need to add code if you want this to handle multiple month jumps$expiry_date = strtotime("$addDays", strtotime($date));
$new_expiry_date = date("Y/m/d @ H:i:s",$expiry_date);
Tried it this way as well:
$_POST[exdays1] - comes from form field$EXday = date('d', mktime(0,0,0,0, date(d) + $_POST[exdays1], 0));
$EXmonth = date('m', mktime(0,0,0, date(m), date(d) + $_POST[exdays1], 0));
$EXyear = date('Y', mktime(0,0,0,date(m) ,date(d) + $_POST[exdays1], date(Y)));
to insert into the DB:
EXmonth = \"$EXmonth\",
EXday = \"$EXday\",
EXyear = \"$EXyear\" ";
Can anyone help? This is driving me nuts!