# Dates and Times

Generate a Zulu Date and/or Time value for a property in your schema, which will be generated and added to the Record at the time a Record is created. Use the following variables in the `format` as you see fit to customize the generated value based on your needs.

* If format is unspecified, the default pattern is `2024-05-09T15:28:51.572Z`.
* `yyyy` = the year as 4 digits
* `M` = the month as 1 or 2 digits
* `MM` = the month as 2 digits
* `d` = the day as 1 or 2 digits
* `dd` = the day as 2 digits
* `D` = the day, month and year as `5/9/2024`
* `DD` = the day, month and year as `May 9, 2024`
* `h` = the hour as 1 or 2 digits, 12 hour clock
* `HH` = the hour as 2 digits, 24 hour clock
* `m` = minute as 1 or 2 digits
* `mm` = minute as 2 digits
* `ss` = second as 2 digits
* `SSS` = millisecond as 3 digits
* `a` = `AM` or `PM`
* `t` = time as `3:06 PM`
* `tt` = time as `3:06:22 PM`
* `T` = time as `15:06`
* `TT` = time as `15:06:22`
* `'custom string'` = the custom string value

{% tabs %}
{% tab title="2024-05-09T15:28:51.572Z" %}
{% code lineNumbers="true" %}

```json
  "properties": {
    "myPropertyName": {
      "type": "string",
      "generate": {
        "type": "datetime",
        "format": ""
      }
    }
  }
```

{% endcode %}
{% endtab %}

{% tab title="May 9, 2024" %}
{% code lineNumbers="true" %}

```json
  "properties": {
    "myPropertyName": {
      "type": "string",
      "generate": {
        "type": "datetime",
        "format": "DD"
      }
    }
  }
```

{% endcode %}
{% endtab %}

{% tab title="5/9/2024, 3:06 PM" %}
{% code lineNumbers="true" %}

```json
  "properties": {
    "myPropertyName": {
      "type": "string",
      "generate": {
        "type": "datetime",
        "format": "D', 't"
      }
    }
  }
```

{% endcode %}
{% endtab %}

{% tab title="3:06 PM" %}
{% code lineNumbers="true" %}

```json
  "properties": {
    "myPropertyName": {
      "type": "string",
      "generate": {
        "type": "datetime",
        "format": "t"
      }
    }
  }
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# 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.contextual.io/documentation-and-resources/components-and-data/object-types/object-type-details/data-schema/generated-properties/dates-and-times.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.
