# DateTime

Creates a datetime from string based on the specified format

```mathematica
DateTime("2023-01-01 9:56:01", DateTimeFormatTemplateOption.`yyyy*MM*dd HH:mm:ss`) → 2023-01-01 09:56:01.000
DateTime("23 Jan 11:56", DateTimeFormatTemplateOption.`dd*shortMonth HH:mm`) → 0000-01-23 11:56:00.000
```

#### Inputs

`DateTime(string, [format])`

* `string` - A string that contains a date in a special format
* `[format]` - Format of the `string`, [**Supported Date and Time Parts**](https://www.notion.so/Supported-Date-and-Time-Parts-aa26c9f4116f47de903d49a19a5e4541?pvs=21), ex. DateTimeFormatTemplateOption.`dd*shortMonth HH:mm`


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tabula.io/data-transformation/formulas/date-and-time-functions/datetime.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
