SYSDATE_TZ()

Overview

Returns the system date and time in the requested time zone.

USAGE

SYSDATE_TZ(zone)

Argument Name

Description

zone

The desired time zone for the result

DETAILS

SYSDATE_TZ() is a date-time function that returns the current date and time in the requested time zone.

The zone argument can be 'UTC', 'GMT', or a number that specifies the positive or negative hourly offset of the timezone.

Unlike the SYSDATE() function, fractional seconds are always included.

The return value is in the YYYY-MM-DD hh:mm:ss.uuuuuu format when used in string context.

The return value is in the YYYYMMDDhhmmss.uuuuuu format when used in numeric context.

Multiple calls to SYSDATE_TZ() in a single statement base their return values on the same moment in time (the start of the statement's execution).

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT SYSDATE_TZ('utc');
+----------------------------+
| SYSDATE_TZ('utc')          |
+----------------------------+
| 2021-07-06 18:34:39.183749 |
+----------------------------+
SELECT SYSDATE_TZ(-7)+0;
+---------------------+
| SYSDATE_TZ(-7)+0    |
+---------------------+
| 20210706123445.8394 |
+---------------------+
SELECT SYSDATE_TZ(0), SYSDATE_TZ(0), SYSDATE_TZ(0);
+----------------------------+----------------------------+----------------------------+
| SYSDATE_TZ(0)              | SYSDATE_TZ(0)              | SYSDATE_TZ(0)              |
+----------------------------+----------------------------+----------------------------+
| 2021-07-06 18:34:50.219842 | 2021-07-06 18:34:50.219842 | 2021-07-06 18:34:50.219842 |
+----------------------------+----------------------------+----------------------------+

ERROR HANDLING

FEATURE INTERACTION

RESPONSES

DIAGNOSIS

ISO 9075:2016

CHANGE HISTORY

Release Series

History

23.09

  • Present starting in MariaDB Xpand 23.09.1.

6.1

  • Present starting in MariaDB Xpand 6.1.0.

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.0

  • Present starting in MariaDB Xpand 6.0.3.

5.3

  • Present starting in MariaDB Xpand 5.3.13.

Release Series

History

6.1

  • Present starting in MariaDB Xpand 6.1.0.

EXTERNAL REFERENCES