2008-7-4 16:48
acme1921209
这个是以前在论坛里看到关于date类型的描述,希望对你有用:
Date和time在后台的数据类型:
Date and time data (Timestamps)
The date data type is used to store a three-part value (year, month, and day) that designates a valid calendar data. The range for the year part is 0001 to 9999; the range for the month part is 1 to 12; and the range for the day part is 1 to n (28, 29, 30, or 31) where n is dependent upon the month part and whether the year part corresponds to a leap year. Externally, the date data type appears to be a fixed-length character string data type that has a length of 10. However, internally, the date data type requires much less storage space–4 bytes of space is required for each value stored, because date values are stored as packed strings. The term DATE is used to declare a date column in a table definition.
The time data type is used to store a three-part value (hours, minutes, and seconds) that designates a valid time of day under a 24-hour clock. The range for the hours part is 0 to 24; the range for the minutes part is 0 to 59; and the range for the seconds part is also 0 to 59. (If the hours part is set to 24, the minutes and seconds parts must be set to 0.) Externally, the time data type appears to be a fixed-length character string data type that has a length of 8. However, like date values, time values are stored as packed strings–in this case, 3 bytes of space is required for each time value stored. The term TIME is used to declare a time column in a table definition