databasejournal.com databasejournal.com

MySQL date and time functions, Part 2 - Page 3

Date functions reference ADDDATE(datetime, INTERVAL expression datetimetype)A synonym for DATE_ADD() CURDATE()A synonym for CURRENT_DATE() CURRENT_DATE()Returns the current system date as YYYY-MM-DD (or YYYYMMDD if the context requires this, such as when you add a numeric to the result) mysql> SELECT CURRENT_DATE(); +----------------+ | CURRENT_DATE() | +----------------+ | 2003-04-14 | +----------------+ CURRENT_TIME()Returns...

databasejournal.com databasejournal.com

MySQL date and time functions, Part 2 - Page 2

Date formats The DATE_FORMAT function is a powerful function that allows you to return a specified date in a number of different ways. For example, those who use American time (MM-DD-YYYY, as you can see at the beginning of this article) instead of the standard International time, this function provides a painless way to convert. Below is a list of format specifiers: %aAbbreviation of the day (from Sun-Sat) %bAbbreviation of the month...