Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
advisory firm) that tracks appointments and seminars in MySQL. For help locating the appropriate function, see the next section or the index at the end of this book. Date and Time Functions Grouped by Type Following are lists of date and time functions, grouped according to their purpose: to retrieve the date or time, to extract an element from a given date or time, or to perform calculations on given dates or times. Determining the Date or Time CURDATE() , CURRENT_DATE( ) , CURRENT_TIME( ) , CURRENT_TIMESTAMP() , CURTIME() , LO- CALTIME() , LOCALTIMESTAMP( ) , NOW( ) , SYSDATE( ) , UNIX_TIMESTAMP() , UTC_DATE() , UTC_TIME() , UTC_TIMESTAMP( ) . Extracting and Formatting the Date or Time DATE() , DATE_FORMAT( ) , DAY( ) , DAYNAME( ) , DAYOFMONTH() , DAYOFWEEK() , DAYOF- YEAR() , EXTRACT() , GET_FORMAT( ) , HOUR( ) , LAST_DAY() , MAKEDATE() , MAKETIME() , MICROSECOND() , MINUTE( ) , MONTH( ) , MONTHNAME() , QUARTER() , SECOND() , STR_TO_DATE() , TIME( ) , TIME_FORMAT( ) , TIMESTAMP() , WEEK() , WEEKDAY() , WEEKOF- YEAR() , YEAR() , YEARWEEK( ) .