The DATE, DATETIME, and TIMESTAMP Types The  TIMESTAMP  data type is used for values that contain both date and time parts.  TIMESTAMP  has a range of  ’1970-01-01 00:00:01’  UTC to  ’2038-01-19 03:14:07’  UTC. A  DATETIME  or  TIMESTAMP  value can include a trailing fractional seconds part in up to microseconds (6 digits) precision. In particular, any fractional part in a value inserted into a  DATETIME  or  TIMESTAMP column is stored rather than discarded. With the fractional part included, the format for these values is  ’ YYYY-MM-DD hh:mm:ss [. fraction ]’ , the range for  DATETIME  values is  ’1000-01-01 00:00:00.000000’  to  ’9999-12-31 23:59:59.999999’ , and the range for  TIMESTAMP  values is ’1970-01-01 00:00:01.000000’  to  ’2038-01-19 03:14:07.999999’ . The fractional part should always be separated from the rest of the time by a decimal point; no other fractional seconds delimiter is recognized. For information about fractional seconds support in MySQL, see Section 11.2.6, “Fractional Seconds in Time Values” . The  TIMESTAMP  and  DATETIME  data types offer automatic initialization and updating to the current date and time. For more information, see Section 11.2.5, “Automatic Initialization and Updating for TIMESTAMP and DATETIME” . MySQL converts  TIMESTAMP  values from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as  DATETIME .) By default, the current time zone for each connection is the server’s time. The time zone can be set on a per-connection basis. As long as the time zone setting remains constant, you get back the same value you store. If you store a  TIMESTAMP  value, and then change the time zone and retrieve the value, the retrieved value is different from the value you stored. This occurs because the same time zone was not used for conversion in both directions. The current time zone is available as the value of the  time_zone  system variable. For more information, see Section 5.1.15, “MySQL Server Time Zone Support” . As of MySQL 8.0.19, you can specify a time zone offset when inserting  TIMESTAMP  and  DATETIME  values into a table. The offset is appended to the time part of a datetime literal, with no intravening spaces, and uses the same format used for setting the  time_zone  system variable, with the following exceptions: The value inserted must not have a zero for the month part, the day part, or both parts. This is enforced beginning with MySQL 8.0.22, regardless of the server SQL mode setting. This example illustrates inserting datetime values with time zone offsets into  TIMESTAMP  and  DATETIME columns using different  time_zone  settings, and then retrieving them: 2025 mysql>  CREATE TABLE ts ( -> id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, -> col TIMESTAMP NOT NULL ->  ) AUTO_INCREMENT = 1; mysql>  CREATE TABLE dt ( -> id INT NOT NULL AUTO_INCREMENT PRIMARY KEY, -> col DATETIME NOT NULL ->  ) AUTO_INCREMENT = 1; mysql>  SET @@time_zone = ’SYSTEM’; mysql>  INSERT INTO ts (col) VALUES (’2020-01-01 10:10:10’), -> (’2020-01-01 10:10:10+05:30’), (’2020-01-01 10:10:10-08:00’); •For hour values less than than 10, a leading zero is required. •The value  ’-00:00’  is rejected. •Time zone names such as  ’EET’  and  ’Asia/Shanghai’  cannot be used;  ’SYSTEM’  also cannot be used in this context.