18 for more information. MariaDB does not currently support time zone literals that contain time zone identifiers. See MDEV-11829 for more information. Limitations ----------- * Because the TIMESTAMP value is stored as Epoch Seconds, the timestamp value '1970-01-01 00:00:00' (UTC) is reserved since the second #0 is used to represent '0000-00-00 00:00:00'. * In MariaDB 5.5 and before there could only be one TIMESTAMP column per table that had CURRENT_TIMESTAMP defined as its default value. This limit has no longer applied since MariaDB 10.0. SQL_MODE=MAXDB -------------- If the SQL_MODE is set to MAXDB, TIMESTAMP fields will be silently converted to DATETIME. Internal Format --------------- In MariaDB 10.1.2 a new temporal format was introduced from MySQL 5.6 that alters how the TIME, DATETIME and TIMESTAMP columns operate at lower levels. These changes allow these temporal data types to have fractional parts and negative values. You can disable this feature using the mysql56_temporal_format system variable. Tables that include TIMESTAMP values that were created on an older version of MariaDB or that were created while the mysql56_temporal_format system variable was disabled continue to store data using the older data type format. In order to update table columns from the older format to the newer format, execute an ALTER TABLE... MODIFY COLUMN statement that changes the column to the *same* data type. This change may be needed if you want to export the table's tablespace and import it onto a server that has mysql56_temporal_format=ON set (see MDEV-15225). For instance, if you have a TIMESTAMP column in your table: SHOW VARIABLES LIKE 'mysql56_temporal_format'; +-------------------------+-------+ | Variable_name | Value | +-------------------------+-------+ | mysql56_temporal_format | ON | +-------------------------+-------+ ALTER TABLE example_table MODIFY ts_col TIMESTAMP; When MariaDB executes the ALTER TABLE statement, it converts the data from the older temporal format to the newer one. In the event that you have several tables and columns using temporal data types that you want to switch over to the new format, make sure the system variable is enabled, then perform a dump and restore using mysqldump. The columns using relevant temporal data types are restored using the new temporal format. Starting from MariaDB 10.5.1 columns with old temporal formats are marked with a /* mariadb-5.3 */ comment in the output of SHOW CREATE TABLE, SHOW COLUMNS, DESCRIBE statements, as well as in the COLUMN_TYPE column of the INFORMATION_SCHEMA.COLUMNS Table. SHOW CREATE TABLE mariadb5312_timestamp\G *************************** 1. row *************************** Table: mariadb5312_timestamp Create Table: CREATE TABLE `mariadb5312_timestamp` ( `ts0` timestamp /* mariadb-5.3 */ NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(), `ts6` timestamp(6) /* mariadb-5.3 */ NOT NULL DEFAULT '0000-00-00 00:00:00.000000' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 Note: Prior to MySQL 4.1 a different format for the TIMESTAMP datatype was used. This format is unsupported in MariaDB 5.1 and upwards. Examples -------- CREATE TABLE t (id INT, ts TIMESTAMP); DESC t; +-------+-----------+------+-----+-------------------+------------------------- ---+ | Field | Type | Null | Key | Default | Extra | +-------+-----------+------+-----+-------------------+------------------------- ---+ | id | int(11) | YES | | NULL | | | ts | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP | +-------+-----------+------+-----+-------------------+------------------------- ---+ INSERT INTO t(id) VALUES (1),(2); SELECT * FROM t; +------+---------------------+ | id | ts | +------+---------------------+ | 1 | 2013-07-22 12:50:05 | | 2 | 2013-07-22 12:50:05 | +------+---------------------+ INSERT INTO t VALUES (3,NULL),(4,'2001-07-22 12:12:12'); SELECT * FROM t; +------+------------------l