Date Symbols in DATE_FORMAT, TIME_FORMAT, and FROM_UNIXTIME
%W day of week Monday to Sunday
%a day of week abbreviated Mon to Sun
%e day of month 1 to 31
%d day of month two-digit 01 to 31
%D day of month with ending 1st, 2nd, 3rd, 4th, ...
%w day of week as number 0 (Sunday) to 6 (Saturday)
%j day in year, three-digit 001 to 366
%U week number, two-digit (Sunday) 00 to 52
%u week number, two-digit (Monday) 00 to 52
%M name of month January to December
%b name of month abbreviated Jan to Dec
%c month number 1 to i
%m month number, two-digit 01 to 12
%Y year, four-digit 2002, 2003, ...
%y year, two-digit 00, 01, ...
%% the symbol % %
Related examples in the same category
1. | Format a date 1 | | |
2. | Format a date 2 | | |
3. | Format a date 3 | | |
4. | Format a date 4 | | |
5. | Format a date 5 | | |
6. | Time Symbols in DATE_FORMAT, TIME_FORMAT, and FROM_UNIXTIME | | |
7. | Common used flags for DATE_FORMAT() | | |
8. | DATE_FORMAT Specifiers | | |
9. | DATE_FORMAT function | | |
10. | SELECT DATE_FORMAT('2005-12-31', '%M %d %Y') | | |
11. | SELECT DATE_FORMAT('2005-12-31', '%D of %M') | | |
12. | To return the birthdays of all staff in the format MM/DD/YYYY, use the DATE_FORMAT() function | | |
13. | SELECT DATE_FORMAT("2010-08-30 21:19:58", "%W %M %d %Y"); | | |
14. | SELECT DATE_FORMAT("2010-08-30 21:19:58", "%a. %b %e, '%y"); | | |
15. | SELECT DATE_FORMAT("2010-08-30 21:19:58", "%m-%e-%Y %l:%i%p"); | | |
16. | SELECT DATE_FORMAT("2010-08-30 21:19:58", "%m-%e-%Y %h:%i%s%p %W"); | | |
17. | SELECT DATE_FORMAT("2010-08-30 21:19:58", "%M %D,%Y %k:%i CST %W"); | | |
18. | Formatting Dates and Times | | |
19. | SELECT @@GLOBAL.DATETIME_FORMAT | | |
20. | SET @@SESSION.DATETIME_FORMAT = DEFAULT | | |
21. | Decomposing Dates and Times Using Formatting Functions | | |
22. | Telling MySQL How to Display Dates or Times | | |
23. | The DATE and TIME data types use the following format: | | |
24. | Present a date differently than in CCYY-MM-DD format or present a time without the seconds part | | |
25. | Calculating One Date from Another by Substring Replacement | | |
26. | The string replacement technique can be used to produce dates with a specific position within the calendar year | | |
27. | For Christmas, replace the month and day with 12 and 25: | | |
28. | %a is the abbreviated weekday name, %D is the day of month with the suffix attached, %b is the abbreviated mon | | |