GET_FORMAT()

Overview

Returns a format string that can be used for rendering dates and time values.

USAGE

GET_FORMAT({DATE|TIME|DATETIME|TIMESTAMP}, {'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL'})

Argument Name

Description

DATE|TIME|DATETIME|TIMESTAMP

The date value type

'EUR'|'USA'|'JIS'|'ISO'|'INTERNAL'

The format type or locale

DETAILS

GET_FORMAT() returns a format string for the given date component and format type.

The return value can be passed to functions such as DATE_FORMAT(), STR_TO_DATE(), and FROM_UNIXTIME().

A NULL is returned if the second argument is NULL.

SYNONYMS

SCHEMA

PARAMETERS

SKYSQL

PRIVILEGES

EXAMPLES

SELECT GET_FORMAT(DATE, 'EUR');
+-------------------------+
| GET_FORMAT(DATE, 'EUR') |
+-------------------------+
| %d.%m.%Y                |
+-------------------------+
SELECT GET_FORMAT(DATETIME, 'USA');
+-----------------------------+
| GET_FORMAT(DATETIME, 'USA') |
+-----------------------------+
| %Y-%m-%d %H.%i.%s           |
+-----------------------------+

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