Skip to main content

$toDate

The $toDate operator parses a string representation of a date into a date object.

Input

  • A single string value containing a date in a standard format

Output

  • A date object representing the parsed date

Examples

Parse ISO Date

Result: Date object representing January 15, 2023 at 10:30:00 UTC

Parse Different Format

Result: Date object representing January 15, 2023

Field Value

Result: A date object representing the date in the date_string field