Search the MySQL manual:

6.2.2.4 The YEAR Type

The YEAR type is a 1-byte type used for representing years.

MySQL retrieves and displays YEAR values in YYYY format. The range is 1901 to 2155.

You can specify YEAR values in a variety of formats:

Illegal YEAR values are converted to 0000.

User Comments

Posted by [name withheld] on Monday August 12 2002, @7:53am[Delete] [Edit]

Since there doesn't seem to be a date type for
representing historic dates (eg. 2300 BC, or 129
CE), how would I achieve this using the existing date
type? Or is there something I'm missing?

Posted by Rolf Vreijdenberger on Tuesday December 3 2002, @4:18pm[Delete] [Edit]

When trying to insert ´historical´ values try using
a smallint (5) signed. this will give you values in the
range of -9999 to 99999

Posted by Patrick Settle on Monday June 16 2003, @9:26pm[Delete] [Edit]

For my needs (timelines, etc, etc), having a separate year field would be impractical. So I have a BIGINT field, as my date field. Then use the programing language to sort out the number into a friendlier format. If the number is negative then the application (in this case a php website) sets the age to BCE. The raw format I put the dates into would be YEAR MONTH DAY. Example:
March 12, 2500 BCE == -25000312
March 12, 2003 == 20030312

With the BIGINT I can get dates from Jan. 1 922337203685477 BCE to Dec. 31 922337203685477 CE

Of course, there may be better ways...like perhaps MySQL being so kind as to add support for BCE/CE dates with years longer than 4 digits.

Add your own comment.