Hoping someone here can help me out....
I'm sure there's a better way to code this, and pointers would be greatly appreciated, but my immediate problem is figuring out how to return the correct date.
Upon retrieving $date1 from the database, I format it like so:
/* **** This will convert the DateTime from MySQL to this format: 25-Dec-05 **** */
$date1 = date("d-M-y", strtotime($row['Expiration_Date']));
/* **** But, I store the date in MySQL in a different format, so I do this to create a value for a hidden input field **** */
$date2 = date("Y-m-d h:i:s", strtotime($date1));
/* **** Users can select the number of days that want to increase the Expiration date by, so I tried this: **** */
$date3 = strtotime("1 day", $date2);
/* **** The above generates this: 88405, so I try to convert it back to Y-m-d: **** */
$date4 = date("Y-m-d h:i:s", strtotime($date3));
/* **** But that just returns: 2014-12-05 12:00:00 **** */
So, basically, Expiration_Date is stored in mysql as Y-m-d h:i:s. I want to retrieve this value and display it as d-M-y. Then, I want to be able to add X days to it, and convert it back to Y-m-d h:i:s before updated my database.
Can someone help me out here?