# Date Parser & Cron API: Natural Language to ISO Dates (`tudorlane/date-parse-cron`) Actor

Turn natural-language dates like 'next Tuesday 3pm' or 'in 2 weeks' into exact ISO datetimes in any time zone (200+ languages), and explain cron expressions with their next run times.

- **URL**: https://apify.com/tudorlane/date-parse-cron.md
- **Developed by:** [Tudor Lane](https://apify.com/tudorlane) (community)
- **Categories:** Developer tools
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 date or cron parses

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Date Parser & Cron API: Natural Language to ISO Dates

**Use when:** a scheduling, calendar, chat or automation agent needs to turn a human date like "next Tuesday 3pm EST", "in 3 days" or "25 Dec" into an exact ISO timestamp in a given time zone, or needs a cron expression explained in plain English with its next run times.

**Try this input**

```json
{"requests": [{"text": "next Tuesday 3pm EST", "timezone": "America/New_York"}, {"text": "le 3 mars à 14:00", "timezone": "Europe/Paris", "convert_to": "Asia/Tokyo"}, {"cron": "0 9 * * 1-5", "timezone": "UTC", "count": 3}]}
```

**Sample output** (real run, 30 Oct 2026, `now` = 2026-10-30T12:00Z)

```json
{"action": "parse", "text": "next Tuesday 3pm EST", "timezone": "America/New_York", "datetime": "2026-11-03T15:00:00-05:00",
 "date": "2026-11-03", "time": "15:00:00", "weekday": "Tuesday", "utc": "2026-11-03T20:00:00+00:00", "unix": 1793736000,
 "relative_seconds": 374400, "relative_days": 4.33, "iso_week": 45, "now": "2026-10-30T12:00:00+00:00"}
{"action": "cron", "cron": "0 9 * * 1-5", "timezone": "UTC", "description": "At 09:00, Monday through Friday",
 "next_runs": ["2026-11-02T09:00:00+00:00", "2026-11-03T09:00:00+00:00", "2026-11-04T09:00:00+00:00"]}
```

Each item is either `text` (a date phrase) or `cron` (5-field expression), with optional `timezone` (IANA, default UTC), `now` (reference time, for repeatable results), `convert_to` (second time zone), `language`, `date_order` (`MDY`/`DMY`; US zones default to month-first), `find_all` (pull every date out of a sentence) and `count` (cron runs, default 5). Up to 5000 items per run; no API key needed.

**Pricing:** pay per event, **$0.001 per date or cron parse**. Rows with errors are not charged.

### Limits & failure modes

- Vague phrases ("soon", "later") return an error row (not charged).
- Relative dates depend on the reference time: pass `now` for repeatable results.
- Some non-English shorthand times are misread, e.g. French "14h" (use "14:00"). Check `datetime` when parsing other languages.
- Cron is standard 5-field; Quartz seconds, `L` and `#` may not be supported.
- No holiday or working-day awareness (use tudorlane/world-holidays-working-days).
- Open-source libraries: dateparser (BSD), croniter (MIT), cron-descriptor (MIT), IANA tz database.

Last tested: 30 Oct 2026.

### Use from AI agents (MCP)

- **Apify MCP server:** add `https://mcp.apify.com/?tools=tudorlane/date-parse-cron` to Claude, Cursor, ChatGPT, VS Code or any MCP client.
- **REST:** `POST https://api.apify.com/v2/acts/tudorlane~date-parse-cron/run-sync-get-dataset-items?token=YOUR_TOKEN` with the input JSON.

# Actor input Schema

## `requests` (type: `array`):

Each item: {"text": "next Friday 5pm", "timezone": "Europe/London"} or {"cron": "0 9 \* \* 1-5", "timezone": "UTC", "count": 5}. Optional: now, convert_to, language, find_all. Max 5000. Errors are not charged.

## Actor input object example

```json
{
  "requests": [
    {
      "text": "next Tuesday at 3pm",
      "timezone": "Europe/London"
    },
    {
      "text": "in 3 days",
      "timezone": "America/New_York"
    },
    {
      "cron": "0 9 * * 1-5",
      "timezone": "UTC"
    }
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

One item per request.

## `dataset` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "requests": [
        {
            "text": "next Tuesday at 3pm",
            "timezone": "Europe/London"
        },
        {
            "text": "in 3 days",
            "timezone": "America/New_York"
        },
        {
            "cron": "0 9 * * 1-5",
            "timezone": "UTC"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("tudorlane/date-parse-cron").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "requests": [
        {
            "text": "next Tuesday at 3pm",
            "timezone": "Europe/London",
        },
        {
            "text": "in 3 days",
            "timezone": "America/New_York",
        },
        {
            "cron": "0 9 * * 1-5",
            "timezone": "UTC",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("tudorlane/date-parse-cron").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "requests": [
    {
      "text": "next Tuesday at 3pm",
      "timezone": "Europe/London"
    },
    {
      "text": "in 3 days",
      "timezone": "America/New_York"
    },
    {
      "cron": "0 9 * * 1-5",
      "timezone": "UTC"
    }
  ]
}' |
apify call tudorlane/date-parse-cron --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tudorlane/date-parse-cron"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/8fF6qoiq2N1BbXsZV/builds/rcmFs5U6xu4yzV6dO/openapi.json
