O'Reilly logo

MySQL 8 Administrator's Guide by Subhash Shah, Hetal Oza, Ankit Bhavsar, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

DATE, DATETIME, and TIMESTAMP types

This section describes the most commonly used MySQL date and time data types: DATE, DATETIME, and TIMESTAMP. This section explains the similarities and differences between these data types.

The DATE data type is suitable when the values we wish to store have a date part, but the time part is missing. The standard MySQL date format is YYYY-MM-DD. The date values are retrieved and displayed in the standard format unless DATE functions are applied. The MySQL supported range of values is 1000-01-01 to 9999-12-31. Supported, here, means the values may work, but there is no guarantee. The same is the case for the DATETIME data type.

The DATETIME data type is suitable for values containing date and time parts. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required