MySQL UTC_DATE is one of Date Function, which is used to return the current UTC date value in YYYY-MM-DD or YYYYMMDD format. In this article, we will show you, How to use this UTC_DATE function in MySQL with example.
MySQL UTC_DATE Syntax
The basic syntax of the UTC date Function in MySQL is as shown below:
MySQL UTC_DATE Example
The following query will show you the basic use of this MySQL UTC date function.
As you can see from the above screenshot, both the statements are returning the same output. I mean, both of them are showing today’s UTC date in YYYY-MM-DD format.
This example show you, what happens when add days to this UTC DATE function.
SELECT UTC_DATE(), UTC_DATE() + 5;
As you can see, it has added those 5 days to current UTC date, and displaying the UTC date in YYYYMMDD string format
MySQL UTC_DATE Example 2
In this example, we are using DATEDIFF function to compare the date difference between the UTC date and a custom date
SELECT DATEDIFF(UTC_DATE(), '2019-02-10');
Thank You for Visiting Our Blog