Hours, minutes, seconds, and microseconds.

See also: Data Types in Xpand 6 and in 5.3


Xpand supports storing fractional second precision for TIME with up to microsecond (6 digit) precision.

MySQL Compatibility

As with MySQL, Xpand will interpret input values supplied to DATE and TIME functions and convert them to a standard format. However, unpredictable results may occur if values are provided in other formats.

Xpand matches MySQL with the exception of:

  • Xpand does not support casting a TIME to a DATETIME and returns NULL.

  • Xpand does not support casting a TIME to a DATE or a DATE to a TIME.

  • When converting from a DATETIME to a DATE, Xpand will discard the the time portion. MySQL will take fractional seconds into account and round the time part.

  • Casting negative value to DATETIME will return a zero date. MySQL returns NULL.

  • When the input to LAST_DAY is a DATETIME, MySQL will round to the nearest DATE before computing LAST_DAY where Xpand does not. For example, LAST_DAY('2013-01-31 23:59:59.999999') returns '2017-01-31' on Xpand and '2017-02-01' on MySQL.

  • If an invalid format string is supplied to STR_TO_DATE, Xpand will return NULL. MySQL ignores extra characters at the end of format string.

  • The results when using EXTRACT with compound units (e.g., DAY_SECOND, DAY_MICROSECOND) may exclude some of the requested units or return incorrect results.

  • Output from datetime functions (e.g., NOW(), INTERVAL() FROM_UNIXTIME(), SUBTIME()) display microsecond precision by default.

  • UNIX_TIMESTAMP() and FROM_UNIXTIME do not support input with fractional seconds.

  • Boolean values (True, False, Null) are accepted in a DATETIME column. This matches the behavior for MySQL v5.5. MySQL v5.6 provides an error message.

  • On Xpand, specifying a zero value for day, month, or year within a date will result in a zero date ('0000-00-00'). MySQL will issue an error (if the sql_mode for NO_ZERO_IN_DATE) is set, or allow zero value for the specific portion of the date.

Replication Compatibility

MariaDB recommends using row-based replication when utilizing fractional seconds.

Fractional seconds cannot be replicated safely from Xpand to MariaDB Enterprise Server.


CREATE TABLE time_example (
  description VARCHAR(30),
  example TIME(6)
  ('HH:MM:SS', '12:34:56'),
  ('HHMMSS', '123456'),
  ('SS.microsec', '42.123456');

The resulting data would look like this:

SELECT * FROM time_example;
| description | example         |
| HH:MM:SS    | 12:34:56.000000 |
| HHMMSS      | 12:34:56.000000 |
| SS.microsec | 00:00:42.123456 |


Release Series



  • Present starting in MariaDB Xpand 6.0.3.


  • Present starting in MariaDB Xpand 5.3.13.