October 2002
Beginner
864 pages
18h 41m
English
This section lists the syntax and examples of MySQL date functions. These functions will be used in the Workshop. Note similarities and differences to ANSI syntax as previously shown in this chapter. MySQL date functions are listed in addition to ANSI SQL functions because date functions tend to differ between SQL implementations.
DATE_FORMAT(date,format) formats the date value according to the format string. The following specifiers can be used in the format string:
| %M | Month name (January..December) |
| %W | Weekday name (Sunday..Saturday) |
| %D | Day of the month with English suffix (1st, 2nd, 3rd, etc.) |
| %Y | Year, numeric, 4 digits |
| %y | Year, numeric, 2 digits |
| %X | Year for the week where Sunday is the first day ... |
Read now
Unlock full access