> ## Documentation Index
> Fetch the complete documentation index at: https://docs.attio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Date

> A timezone-less calendar date

Date attributes are used to represent a single calendar year, month and day, independent of timezone. Attio exclusively works with the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, i.e. `YYYY-MM-DD` e.g. `2023-11-24`.

There is only one default example of a date attribute, `foundation_date` on the company object.

Date attributes can only be single-select.

### Reading values

Date attributes have a single property, `value` (a string).

<CodeGroup>
  ```jsonc Example: 24th November, 2023 theme={"system"}
  {
    "active_from": "2023-04-03T15:21:06.447000000Z",
    "active_until": null,
    "created_by_actor": {
      /*...*/
    },
    "attribute_type": "date",
    "value": "2023-11-24"
  }
  ```
</CodeGroup>

### Writing values

Date values can be written by passing an ISO 8601 date string.

If hours, months, seconds or timezones are provided, they will be trimmed. For example:

* `'2023'` → `'2023-01-01'`
* `'2023-01'` → `'2023-01-01'`
* `'2023-01-02'` → `'2023-01-02'`
* `'2023-01-02T13:00'` → `'2023-01-02'`
* `'2023-01-02T14:00:00'` → `'2023-01-02'`
* `'2023-01-02T15:00:00.000000000'` → `'2023-01-02'`
* `'2023-01-02T15:00:00.000000000+02:00'` → `'2023-01-02'`

If a timezone is provided that would result in a different calendar date in UTC, the date will be coerced to UTC and then the timezone component will be trimmed. For example, the value `'2023-01-02T23:00:00-10:00'` will be returned as `'2023-01-03'`.

As date values are always single-select, you may write values either by passing the date string directly, or by wrapping a single value in an array.

You may also write date values using an object with a single `value` key.

<CodeGroup>
  ```json Using string theme={"system"}
  {
    "foundation_date": "2004-07-29"
  }
  ```

  ```json Using object theme={"system"}
  {
    "foundation_date": [
      {
        "value": "2004-07-29"
      }
    ]
  }
  ```
</CodeGroup>

### Filtering

Date attribute values can be filtered by their value. You can filter for an exact date using the implicit syntax, or use the `$eq`,`$gt`,`$gte`,`$lt`,`$lte` operators with the explicit syntax.

<CodeGroup>
  ```json Companies founded on 2023-11-24 theme={"system"}
  {
    "filter": {
      "foundation_date": "2023-11-24"
    }
  }
  ```

  ```json Companies formed after the year 2000 theme={"system"}
  {
    "filter": {
      "foundation_date": {
        "value": {
          "$gte": "2000-01-01"
        }
      }
    }
  }
  ```
</CodeGroup>
