dimis283 — 2011-09-13T10:17:20-04:00 — #1
I want to insert to mysql a date filed with pdo.
The format of the date variable is 09-13-2011 17:11:09 as I see with die($date)
Also I use this code
$sth = $dbh->prepare($sql);
But nothing is inserting at my db.
What is wrong?
inky2k — 2011-09-15T17:09:30-04:00 — #2
Hello, on how i remember right format must be "year-month-day hour:minute:seconds". hope it help you.
starlion — 2011-09-16T08:08:16-04:00 — #3
Yes, as inky states, the correct format (in PHP's Date-String) is Y-m-d H:i:s (or YYYY-MM-DD HH:MM:SS).