Howdy, guys... 🙂
I am having problem with '1 month later from today'...
I am basically making a register routine that will activate the username for one month period... That 'month' term is abit unclear, but I want it for one calendar month... In other words, if I register on 12/31, then the membership expires on 1/31, and 2/29 if I register on 1/31...
In MySQL command that's in the PHP script, I have this line...
$sql = "INSERT INTO " . MEMBERSHIP_TABLE . "(`StartDateTime`, `EndDateTime`) VALUES ( CURDATE(), CURDATE() + INTERVAL 1 MONTH);";
and I get to see '2004-01-31 00:00:00' and '2004-02-29 00:00:00'... Well... It seems to be just what I want... 🙂
In PHP, I have found this script from the forum... and I think it is basically adding 31 days to the previous date and I don't really want it...
$regDate = date("m/d/Y", mktime(0, 0, 0, date("m"), date("d"), date("Y")));
$expDate = date("m/d/Y", mktime(0, 0, 0, date("m") + 1, date("d"), date("Y")));
$monthLater = date("m/d/Y", strtotime("+1 month"));
That script returns '01/31/2004' and '03/02/2004' and '03/02/2004'... The last two should be '02/29/2004' but it is not the case... 🙁
So, how do I make the one month later in PHP return one month in calendar day??? Or am I missing something here??? 🙁
Thank you very much... 🙂