Date Time and type
Common date and time types
Bytes
Year 1 represents the range of years values: (1901----2155)
Date 4 is the date of year and month, for example: 2018-03-09 value range: 1000-01-01 to 9999-12-31
Time 3 indicates a value range of seconds and minutes 835:59:59 838:59:59
Dateime 8 represents a combination of date and time, and seconds and minutes: 1000-01-01 00:00:00 9999-12-31 23:59:59
Timestamp 4 means days and seconds
Common time functions
Now () |
Returns the current date and time |
Curdate () |
Returns the current date |
Curtime () |
Returns the current time |
DATE () |
Extract date part of date or date/time expression |
EXTRACT () |
Returns a separate part of the date/time Press |
Date_add () |
Add a specified time interval to a date |
Date_sub () |
Subtract a specified time interval from a date |
DATEDIFF () |
Returns the number of days between two dates |
Date_format () |
Display Date/time in a different format |
MySQL Time type summary and common time function