# date

Source: https://zotonic.com/docs/1745/date

URI: https://zotonic.com/id/1745

Language: en



Validate input date against a given date format.

A quick guide to validating a date in Zotonic:

```django
<input type="text" id="my_date" name="my_date" value="" />
{% validate id="my_date" type={date separator="-" format="b"} %}
```

This code validates when the user enters a date in the following format:

```none
yyyy-mm-dd
```

Arguments
---------

| Argument    | Description                                                                      | Example         |
| ----------- | -------------------------------------------------------------------------------- | --------------- |
| `separator` | Character used to separate date parts, such as `/` `-` `\`. Defaults to `"-"`.   | `separator="-"` |
| `format`    | Date format, big endian (starting with year), little endian (starting with day) or middle endian (starting with month). Defaults to `"l"` (little). | `format="m"`    |

License: 

Attribution: 

Related resources: https://zotonic.com/api/agent/related/1745?language=en


## API access

- [API help](<https://zotonic.com/api-help>)
- [OpenAPI specification](<https://zotonic.com/openapi.json>)
- [This resource as JSON](<https://zotonic.com/api/agent/resource/1745?language=en>)
