Complete the code to get the current time in UTC.
SELECT [1]();The UTC_TIMESTAMP() function returns the current UTC date and time.
Complete the code to convert a datetime from UTC to 'America/New_York' time zone.
SELECT CONVERT_TZ('2024-06-01 12:00:00', [1], 'America/New_York');
The second argument of CONVERT_TZ is the source time zone. Since the datetime is in UTC, use 'UTC'.
Fix the error in the code to get the current time in the 'Asia/Tokyo' time zone.
SELECT CONVERT_TZ(NOW(), [1], 'Asia/Tokyo');
Since NOW() returns the server's local time, the source time zone should be 'SYSTEM' to convert correctly to 'Asia/Tokyo'.
Fill both blanks to get the current time in UTC and convert it to 'Europe/London' time zone.
SELECT CONVERT_TZ([1](), [2], 'Europe/London');
Use UTC_TIMESTAMP() to get current UTC time and specify source time zone as 'UTC' for conversion.
Fill all three blanks to create a query that converts '2024-06-01 15:00:00' from 'Europe/Paris' to 'Asia/Kolkata' and formats the output as 'YYYY-MM-DD HH:MM:SS'.
SELECT DATE_FORMAT(CONVERT_TZ('2024-06-01 15:00:00', [1], [2]), [3]);
The first two blanks are the source and target time zones. The third blank is the format string for standard datetime output.