Temporal data types are used to deal with time/date information.
Below table summarizes the temporal data types supported by MySQL.
Data Type |
Default format |
date |
YYYY-MM-DD |
year |
YYYY |
time |
HHH:MI:SS |
timestamp |
YYYY-MM-DD HH:MI:SS |
datetime |
YYYY-MM-DD HH:MI:SS |
YYYY: Specifies the year in range 1000 to 9999
MM: Specifies month of the year, 1 to 12.
DD: Specifies day of the month, 1 to 31
HH: Specifies hour of the day, 0 to 23
MI: Specify minutes, 0 to 59
HHH: Hours elapsed, -838 to 838
SS: Seconds, 0 to 59
Previous Next Home
No comments:
Post a Comment