How-dee, fellow PHPBuilders!
I did a few searches pertaining to my query, but wasn't even really sure what terms to search for, 'cause I'm not sure how to put it into words. 😕
In any case, as I understand it, it's the $date function of PHP that magically knows today's day, month, date, year, and time . . . and I use that magic to, say, create drop-click form doohickeys that are pre-selected to the current date, to save trouble for folks who use the forms.
Does that magic come from the UTC clock, or whatever it's called? Epoch? Something like that? Y'know, the one big number, like 5106897106840321 or something?
If that's the case, could one theoretically add the right amount of numbers (ie, the number of seconds in a day) to pre-set a drop-click form doohickey to tomorrow's date? Next week's? Next month's?
I mean, I can't just, say add seven days to the current date, as that'd make it November 31st, a date that doesn't exist. So, would adding numbers to the UTC/Epoch number work?
I've got this test file, http://www.happydesigns.com/testepoch.php (for the sake of keeping things clean while testing, I'm not bothering with the array that'll change the month to a word), where the first line worked fine.
$day = date("l");
$month = date("m");
$date = date("j");
$year = date("Y");
echo "Today is $month / $date / $year, and it's a $day!</p>";
However, adding the seconds that occur within a week didn't seem to work for me. 😃
$day = date("l") + 864000;
$month = date("m") + 864000;
$date = date("j") + 864000;
$year = date("Y") + 864000;
echo "Next week is $month / $date / $year, and it's a $day!</p>";
I tried it inside and outside of the brackets but, more than likely, I'm goin' about it all wrong. =(
Any thoughts on how to make it go, if it's even possible?
Thanks in advance for any assistance!