# GET\_FORMAT

Return a format string for the specified datetime type and standard.

The result format string can be used with [STR\_TO\_DATE](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/str-to-date.md) and [SEC\_TO\_TIME](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/sec-to-time.md).

## Syntax

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

```

## Return Type

[DATE\_FORMAT](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/date-format.md)

## Examples

```sql
SELECT GET_FORMAT(DATE, 'USA');

```

```output

+-------------------------+
| GET_FORMAT(DATE, 'USA') |
+-------------------------+
| %m.%d.%Y                |
+-------------------------+

```

```sql
SELECT GET_FORMAT(DATETIME, 'INTERNAL');

```

```output

+----------------------------------+
| GET_FORMAT(DATETIME, 'INTERNAL') |
+----------------------------------+
| %Y%m%d%H%i%s                     |
+----------------------------------+
```

**Related Topics**

* [DATE\_FORMAT](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/date-format.md)
* [STR\_TO\_DATE](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/str-to-date.md)

***

Modified at: May 31, 2023

Source: [/cloud/reference/sql-reference/date-and-time-functions/get-format/](https://docs.singlestore.com/cloud/reference/sql-reference/date-and-time-functions/get-format/)

(An index of the documentation is available at /llms.txt)
