--- type: "fhirpath-function" title: "FHIRPath Function: toDate" function: "toDate" category: "Conversion" section: "5.5.4.2" source: "fhirpath/functions.json" --- # FHIRPath Function: toDate _No canonical section match found in index.md._ ## Summary - **Category**: Conversion - **Section**: `5.5.4.2` - **Return Type**: `Date` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description If the input collection contains a single item, this function will return a single date if the item is a Date, a DateTime, or a String convertible to a Date. ## Arguments - `format` (optional): `String` - Optional format template for parsing string input (STU). Uses date/datetime format codes when provided instead of the default format. ## Type Mapping - `Date-Date` - `DateTime-Date` - `String-Date` ## Example ```fhirpath '2022-01-01'.toDate() // returns @2022-01-01 ```