Skip to main content

DATETIME vs TIMESTAMP

Learn DATETIME vs TIMESTAMP (Data Types, MySQL) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Introduction Both store date and time. DATETIME (5 bytes plus fraction, 1000 to 9999) stores the literal value with no time zone conversion. TIMESTAMP (4 bytes plus fraction, 1970-01-01 00:00:01 UTC to 2038-01-19 03:14:07 UTC) is stored as UTC and converted to and from the session time zone.

More lessons in Data Types