MySQL - what is the difference between DATETIME and TIMESTAMP?

6 points
Asked by:
Dirask Community

Both DATETIME and TIMESTAMP contain the date and time parts, so can you tell me what's the difference between them?

1 answer
6 points
Answered by:
Dirask Community

There are several differences between DATETIME and TIMESTAMP types.

1. Range:

  • DATETIME┬ásupported range is from┬á'1000-01-01 00:00:00'┬áto┬á'9999-12-31 23:59:59',
  • TIMESTAMP┬ásupported range is from┬á'1970-01-01 00:00:01'┬áUTC to┬á'2038-01-19 03:14:07'┬áUTC.

2. Usage:

  • TIMESTAMP┬áis generally used to track changes to records, and is┬áoften updated every time the record is changed,
  • DATETIME┬áis generally used to store a specific value.


Go to the docummentation to read more about DATETIME and TIMESTAMP types. - Link.

0 comments Add comment
Native Advertising
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ÔŁĄ´ŞĆ­čĺ╗ ­čÖé