I would have never thought that formatting a simple expiration date would kick my butt so much but it has...
OK, the end goal is to calculate a date XX amount of months in advance for an item to expire. I think I should be able to do this with mktime(). However, currently, I'm seeing discrepencies which I cannot explain, so please Help.
<?php
echo "echoing the test Date 1977-02-26<br />";
$birthtime = strtotime('1977-02-26');
$day = date("d", $birthtime);
$month = date("m", $birthtime);
$year = date("Y", $birthtime);
$birth1 = date("F d Y", strtotime('1977-02-26'));
echo $birth1;
echo "<br>";
echo date("F d Y",$birthtime);
echo "<br>";
$why = date("mdY", mktime(0,0,0,$day,$month,$year));
echo $why;
echo "<br>day=".$day."<br>month=".$month."<br>year=".$year;
The above code returns Some form of February 26 1977 for every value EXCEPT $why .
$why returns 02021979
Can someone please explain to my what is really going on. I have been scouring the manual pages and old posts without any luck.
Thanks,
Cliff
[Mod Edit] Please don't try to get around the filters.