MySQL Crash Course

MySQL uses special datatypes for the storage of date and time values as listed in Table D.3.

Table D.3. Date and Time Datatypes

Datatype

Description

DATE

Date from 1000-01-01 to 9999-12-31 in the format YYYY-MM-DD.

DATETIME

A combination of DATE and TIME.

TIMESTAMP

Functionally equivalent to DATETIME (but with a smaller range).

TIME

Time in the format HH:MM:SS.

YEAR

A 2 or 4 digit year, 2 digit years support a range of 70 (1970) to 69 (2069), 4 digit years support a range of 1901 to 2155.

Категории