
The following table shows the format of the “ zero” Using NULL values, and uses less data andĬonnector/ODBC are converted automatically to MySQL permits you to store a “ zero” value ofĭate.” In some cases, this is more convenient than To disallow zero month or day parts in dates, These, you should not expect to get correct results forĬomplete dates.

MySQL permits you to store dates where the day or month andįor applications that need to store birthdates for which you This mode, MySQL verifies only that the month is in the rangeįrom 1 to 12 and that the day is in the range from 1 to 31. In a web form) in the database for future processing. Wrong” value which the user has specified (for example, This is useful when you want to store a “ possibly (See Section 5.1.10, “Server SQL Modes”.) You can get MySQL Specify more exactly what kind of dates you want MySQL to The exception is that out-of-rangeīy setting the SQL mode to the appropriate value, you can It converts the value to the “ zero” value for Type that is out of range or otherwise invalid for the type, If the value is used in numeric context and vice versa.īy default, when MySQL encounters a value for a date or time MySQL automatically converts a date or time value to a number Section 11.2.8, “Conversion Between Date and Time Types”. See also Section 11.2.9, “2-Digit Years in Dates”.Ĭonversion of values from one temporal type to another occurs Keep in mind these general considerations when working with date

Types, see Section 11.6, “Data Type Storage Requirements”.įor descriptions of functions that operate on temporal values, see Section 11.2.6, “Automatic Initialization and Updating for TIMESTAMP and DATETIME”.įor information about storage requirements of the temporal data May be used when you specify an invalid value that MySQL cannotĪutomatic updating behavior, described in Range of valid values, as well as a “ zero” value that The date and time data types for representing temporal values are 11.2.1 Date and Time Data Type Syntax 11.2.2 The DATE, DATETIME, and TIMESTAMP Types 11.2.3 The TIME Type 11.2.4 The YEAR Type 11.2.5 2-Digit YEAR(2) Limitations and Migrating to 4-Digit YEAR 11.2.6 Automatic Initialization and Updating for TIMESTAMP and DATETIME 11.2.7 Fractional Seconds in Time Values 11.2.8 Conversion Between Date and Time Types 11.2.9 2-Digit Years in Dates
