Name
UTC_TIMESTAMP( )
Synopsis
UTC_TIMESTAMP( )
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 (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 statement
is available as of Version 4.1.1 of MySQL. The pair of parentheses is
not required. Use UTC_TIME( )
for only the UTC
time and UTC_DATE( )
for only the UTC date.
SELECT UTC_TIMESTAMP( ) + 1, UTC_TIMESTAMP( ); +---------------------+---------------------+ | UTC_TIMESTAMP( ) + 1 | UTC_TIMESTAMP( ) | +---------------------+---------------------+ | 20050111200238 | 2005-01-11 20:02:37 | +---------------------+---------------------+
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.