Outdated Version

You are viewing an older version of this section. View current production version.

GET_FORMAT

Return a format string for the specified datetime type and standard. The result format string can be used with DATE_FORMAT and STR_TO_DATE.

Syntax

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

Return Type

A format string. See DATE_FORMAT for a description of format symbols.

Examples

memsql> select GET_FORMAT(DATE, 'USA');
+-------------------------+
| GET_FORMAT(DATE, 'USA') |
+-------------------------+
| %m.%d.%Y                |
+-------------------------+

memsql> select GET_FORMAT(DATETIME, 'INTERNAL');
+----------------------------------+
| GET_FORMAT(DATETIME, 'INTERNAL') |
+----------------------------------+
| %Y%m%d%H%i%s                     |
+----------------------------------+

Related Topics