First things first. Write yourself an EVALFORM... that's much faster.
// Annoying date @!#$ gets worked out here.
$date = getdate();
$minutes = $date['minutes'];
$hours = $date['hours'];
$tz="CST"; / Set your time zone here /
/ init $ampm /
$ampm="AM";
if ($hours > 12) {
$hours=$hours-12;
$ampm="PM";
}
//
/ Fix minutes so that minutes 1-9 have 2 digits /
//
$day = $date[mday];
if ($day < 10) { // weekday only. someone tell me the day of money code?
$day="0$day";
}
$mon = $date[mon];
if ($mon < 10) {
$mon="0$mon";
}
$year = $date[year];
$weekday = $date[weekday];
//
/ Output: H:M AM/PM TIME ZONE /
//
echo "$date[year]-$mon-$day";
James Kass wrote:
I'm trying to figure out how to assign a date to a variable, in this case $axedate, that is seven days from the current date. It will need to inserted into my database in the "YYYY-MM-DD" format.
The documentation thus far is a bit confusing. >:{
Any help would be greatly appreciated. 🙂
Thanks-- James