> For AI agents: the complete Sanity documentation index is available at [https://www.sanity.io/docs/llms.txt](https://www.sanity.io/docs/llms.txt).

# Date

Schema type reference for the Date type.

An ISO-8601 formatted string containing date. E.g. `2017-02-12`. See the [DateDefinition](https://reference.sanity.io/sanity/index/DateDefinition/) reference for the full type definition.

The stored date is represented as a string in compliance with [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) (often described as `YYYY-MM-DD`).

![Screenshot of Date field with a title, description, and value.](https://cdn.sanity.io/images/3do82whm/next/a4780c2c8594ddb523fcf824d3cff6c011be05e9-1152x500.png)

> [!TIP]
> Protip
> If you need to store information about both date and time, use the [datetime](https://www.sanity.io/docs/studio/datetime-type) type instead.

## Properties

#### Properties

**type** (required)

Required. Value must be set to date.

**name** (required)

Required. The field name. This will be the key in the data record.

**title**

Human readable label for the field.

**hidden**

If set to true, this field will be hidden in the studio. You can also return a callback function to use it as a conditional field.

**readOnly**

If set to true, this field will not be editable in the content studio. You can also return a callback function to use it as a conditional field.

**description**

Short description to editors how the field is to be used.

**placeholder**

Placeholder text that appear within the input when it is empty.

**initialValue**

The initial value used when creating new values of this type. Can be a literal value, or a resolver function that returns a literal value or a promise that resolves to one.

**components**

Lets you provide custom components to override the studio defaults in various contexts. The available keys are diff, field, input, item, and preview. This property is in beta.

**deprecated**

Marks a field or document type as deprecated in the studio interface and displays a user-defined message defined by the single required reason property.

If you deploy a GraphQL API schema, this property will translated into the @deprecated directive.

**icon**

Supply a custom icon for this field. See Icons for the supported values.

## Options ([DateOptions](https://reference.sanity.io/sanity/index/DateOptions/))

#### Properties

**dateFormat**

Controls how the date input field formats the displayed date. Default is YYYY-MM-DD.

The format string is Moment-style, but only this subset of tokens is supported: YYYY, YY, MMMM, MMM, MM, M, DD, D, dddd, ddd, HH, H, hh, h, mm, m, ss, s, A, a. Other tokens, including bracket escaping such as [T], are passed through unconverted and stop the input from parsing what it just rendered.

## Validation ([DateRule](https://reference.sanity.io/sanity/index/DateRule/))

#### Properties

**required()**

Ensures that this field exists.

**skip()**

Discards the validation rules set before it in the chain and makes the field optional. Rules chained after it still apply.

**custom(fn)**

Creates a custom validation rule.

**min(minDate)**

Minimum date (inclusive). Accepts an ISO 8601 date string, or a field reference returned by valueOfField().

**max(maxDate)**

Maximum date (inclusive). Accepts an ISO 8601 date string, or a field reference returned by valueOfField().

**error(message)**

Sets a custom error message for the preceding validation rule.

**warning(message)**

Sets a custom warning message for the preceding validation rule. Warnings do not prevent publishing.

**info(message)**

Sets a custom info message for the preceding validation rule. Info messages are purely informational and do not prevent publishing.

**valueOfField(path)**

Gets the value of a sibling field to use in validation. Useful for creating validation rules that depend on the value of another field.

Input

**schemas/movie.ts**

```typescript
import {defineField} from 'sanity'

defineField({
  title: 'Release date',
  name: 'releaseDate',
  type: 'date',
})
```

Response

**Stored value**

```json
{
  "releaseDate": "2017-02-12"
}
```

## Example: set a custom date format

**schemas/movie.ts**

```typescript
import {defineField} from 'sanity'

defineField({
  title: 'Release date',
  name: 'releaseDate',
  type: 'date',
  options: {
    dateFormat: 'MMM D, YYYY',
  },
})
```



## Related changelog entries

Entries are listed newest first; each link points to the full entry as markdown. Follow one when you need to know what changed, when, or why — for example, to summarize recent updates, explain behavior that differs from older documentation, or check whether a fix has shipped.

- [Sanity Studio v5.26.0: Bug fixes and refinements](https://www.sanity.io/docs/changelog/studio-NS4yNS4x.md) — May 19, 2026
- [Sanity Studio v3.26.0: Deprecation Support for Documents and Fields, Comment Reactions ++](https://www.sanity.io/docs/changelog/5a99e214-6088-4d10-a0b7-14ca7c555c01.md) — January 23, 2024
- [Sanity Studio v2.17.0: Conditional Fields](https://www.sanity.io/docs/changelog/10aba481-ece9-4b41-b0e2-6b8e75e375c9.md) — August 26, 2021
- [Sanity Studio v2.6.3: Revamped Date and DateTime inputs](https://www.sanity.io/docs/changelog/59c5a344-2936-40eb-9fb1-5186ea2a7b92.md) — March 18, 2021