Ispirer Ispirer
 


Ispirer Home Page Ispirer SQLWays Product Page - Migration to MySQL Request SQLWays

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


Ispirer Home Page Ispirer SQLWays Product Page - Migration to MySQL Request SQLWays

sqlways/mysql/date-time-functions.txt · Last modified: March 20, 2013, 03:56:24 AM (external edit)
 
© 1999-2018, Ispirer Systems Ltd.
All Rights Reserved.  Privacy Statement