# parseDate

Source: https://taxilang.org/docs/language/stdlib/parseDate

**Full name:** `taxi.stdlib.dates.parseDate`

## Signature

```taxi
declare function <T> parseDate(String):T
```

## Description

Parses a string into a date, datetime, or instant value. The target type determines which parsing rules are applied.

Supported target types are `Date`, `DateTime`, and `Instant`. Use `@Format` on the result field to control the output serialisation format.

```taxi
// Parse an ISO date string into a Date value
find {
   @Format("yyyy-MM-dd")
   eventDate: Date = parseDate("2024-06-15")
}
```

## Examples

Parses ISO date and datetime strings into their respective Taxi date types.

Query:

```taxi
find {
   @Format("yyyy-MM-dd")
   asDate: Date = parseDate("2024-06-15")
   @Format("yyyy-MM-dd HH:mm:ss")
   asDateTime: DateTime = parseDate("2024-06-15T10:30:00")
}
```

Result:

```json
{
  "asDate": "2024-06-15",
  "asDateTime": "2024-06-15 10:30:00"
}
```
