Extract dates from a given text. The API will return a list of dates with their positions in the text and the normalized form of the date. A large list of date formats is supported. For example, the text could contain dates in the form of "April 5th, 2035", "04/05/2035", or "05.04.2035". The normalized date is the date in the form of a timestamp (milliseconds since 1970).
{
"dates": [
{
"start_position": 3,
"date": "April 5th, 2035",
"normalized_date": 2059336800000,
"tag": "DATETIME",
"end_position": 18
}
]
} {{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
{{ codeCopyText }}
The API supports a vast array of date formats, including standard formats like "YYYY-MM-DD", textual formats like "April 5th, 2035", and relative dates like "tomorrow" or "next Friday".
Yes, the API extracts any date mentioned in the text, whether it is in the past, present, or future.
The normalized date is returned as a timestamp (milliseconds since the Unix epoch, January 1, 1970), allowing for easy programmatic comparison and storage.
The Extract Dates API finds all dates mentioned within a text, whereas the Extract Publish Date API specifically looks for the publication date of a web page or article.