MySQL UTC_DATE() Function
In MySQL, the UTC_DATE()
function returns the current UTC date.
If the UTC_DATE()
function is used in a string context, the returned value is in 'YYYY-MM-DD'
format, and if it is used in a numeric context, the returned value is in YYYYMMDD
format.
UTC_DATE()
Syntax
Here is the syntax of MySQL UTC_DATE()
function:
UTC_DATE()
UTC_DATE()
Examples
Returns the current UTC date.
SELECT
UTC_DATE(),
UTC_DATE() + 0;
+------------+----------------+
| UTC_DATE() | UTC_DATE() + 0 |
+------------+----------------+
| 2022-04-16 | 20220416 |
+------------+----------------+
Note: The result of UTC_DATE() + 0
is in YYYYMMDD
format.
UTC_DATE() + N
means adding N days to the current date. For example:
SELECT UTC_DATE() + 1;
+----------------+
| UTC_DATE() + 1 |
+----------------+
| 20220417 |
+----------------+