EN
PHP - datetime format with PDO and MySQL
6
points
In this article date-time formatting with PDO and MySQL is presented.
1. Accepted formats
There are several accepted formats for date and time.
MySQL Type PHP date() Format Example
DATE YYYY-MM-DD 2005-12-26
DATETIME YYYY-MM-DD HH:MI:SS 2005-12-26 23:50:30
TIMESTAMP YYYY-MM-DD HH:MI:SS 2005-12-26 23:50:30
YEAR YYYY or YY 2019 or 19
MySQL with PDO example:
2. Database preparation
//TODO