Ispirer Website Ispirer Capabilities - MySQL Migration Free Trial

MySQL - Date and Time Functions

This article describes date and time functions in MySQL.

Overview

Date and Time Function Description
DATE() Extracts date part (day, month and year)

DATE

MySQL - DATE
Syntax DATE(datetime_expression)
Description DATE extracts the date part (day, month and year) of the datetime expression
Return Value The return type is DATE

Example:

mysql> SELECT DATE(CURRENT_TIMESTAMP), CURRENT_TIMESTAMP;
+-------------------------+----------------------+
| 2009-08-19              | 2009-08-19 12:42:18  |
+-------------------------+----------------------+
1 row in set (0.00 sec)

MySQL DATE - Equivalents in Other Databases

Database Equivalent
Oracle TRUNC(date) - truncates date to year, month, and day

© 1999-2024, Ispirer Systems, LLC. All Rights Reserved.