UTC_TIMESTAMP( )

This MySQL function returns the current UTC date and time in yyyy-mm-dd hh:mm:ss format.

Syntax

Below is the syntax for this command. Text within square brackets (i.e, [ and ] ) are optional. Choices are separated by bars (i.e, | ). Ellipses preceded by a comma indicates a repeating pattern. Ellipses before or after syntax are used to highlight a relevant except from the larger syntax. Text displayed in italic letters represent text that should be replaced with the specific names related to the database (e.g., column with the name of the column).

UTC_TIMESTAMP( )

Explanation

This function returns the current UTC date and time in yyyy-mm-dd hh:mm:ss format. It will return the UTC date and time in a yyyymmddhhmmss format if it's used as part of a numeric calculation. As a numeric, the microseconds are included in the results. This statement is available as of version 4.1.1 of MySQL. The parentheses are optional. Use UTC_TIME( ) is you want only the UTC time, and UTC_DATE( ) if you want only the UTC date.

Examples

SELECT UTC_TIMESTAMP( ),
UTC_TIMESTAMP( ) + 0 AS 'UTC_TIMESTAMP( ) Numeric';

+---------------------+--------------------------+
| UTC_TIMESTAMP( )    | UTC_TIMESTAMP( ) Numeric |
+---------------------+--------------------------+
| 2008-12-07 22:08:24 |    20081207220824.000000 | 
+---------------------+--------------------------+