How to format PHP date() for MySQL’s DateTime DataType
This is a simple call to a function like so:
Get the current time:
$time = date("y-m-d H\:i\:s");
Or get the current time from a timestamp, set to one week from the current time:
$nextWeek = time() + (7 * 24 * 60 * 60);
$time = date("y-m-d H\:i\:s", $nextWeek);
