Name

UTC_DATE( )

Synopsis

UTC_DATE( )

This function returns the current Universal Time Clock (UTC) date in yyyy-mm-dd format. This function will return the UTC date in a yyyymmdd format if it’s used as part of a numeric calculation (see example). You can use this in SELECT statements as shown here, in INSERT and UPDATE statements to set a value, or in a WHERE clause. This function is available as of Version 4.1.1 of MySQL. The pair of parentheses is optional.

SELECT UTC_DATE( ) + 1, UTC_DATE( );
+----------------+------------+
| UTC_DATE( ) + 1 | UTC_DATE( ) |
+----------------+------------+
|       20050112 | 2005-01-11 |
+----------------+------------+

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.