Universal Date & Time Parsing
Transform any date format into structured, timezone-aware timestamps
AnyDate API intelligently parses dates from natural language, ISO formats, Unix timestamps, and localized inputs. Built with FastAPI, dateparser, and parsedatetime for maximum compatibility and accuracy across languages, timezones, and formats.
What This API Does
π Natural Language
Parse "next Monday 8am", "maΓ±ana 5pm", "in 2 hours" in multiple languages
π Timezone Magic
Convert between any timezone with DST awareness and IANA support
π Format Flexibility
Accept ISO dates, Unix timestamps, and return custom strftime formats
π Locale Support
Parse dates in Spanish, French, German, Hindi, and dozens more languages
Quick Start
GET /parse?input=...
β Quick tests and browser-friendly queries
curl "http://127.0.0.1:8000/parse?input=tomorrow%208am&output_timezone=UTC"
POST /parse
β JSON body for complex parameters
curl -X POST "http://127.0.0.1:8000/parse" \ -H "Content-Type: application/json" \ -d '{"input":"2025-08-09"}'
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
input | string | Required | Any date/time text: ISO, Unix timestamp, natural language |
input_timezone | string | Optional | IANA zone (Asia/Kolkata), abbreviation (IST), or offset (UTC+05:30) |
output_timezone | string | Optional | Convert result to this timezone |
locale | string | Optional | Language code (en, es, fr, de, etc.) for natural language parsing |
output_formats | string | array | Optional | One or multiple strftime format strings |
Sample API Response
Here's what a successful API response looks like with all available fields:
{ "success": true, "iso_utc": "2025-08-15T17:00:00+00:00", "iso_output_timezone": "2025-08-15T22:30:00+05:30", "unix_timestamp": 1755277200, "human_readable": "15 August 2025, 10:30 PM IST", "custom_formats": { "%Y-%m-%d": "2025-08-15", "%H:%M %p": "22:30 PM" }, "components": { "year": 2025, "month": 8, "day": 15, "weekday": "Friday", "hour": 22, "minute": 30, "second": 0, "timezone": "IST", "utc_offset": "+0530", "day_of_year": 227, "week_of_year": 33, "quarter": 3, "is_weekend": false, "is_weekday": true, "am_pm": "PM", "is_leap_year": false }, "input_locale_detected": null, "input_original": "next friday 6pm" }
Response Fields Explained
success
β Always true for valid responsesiso_utc
β ISO format in UTC timezoneiso_output_timezone
β ISO in requested timezoneunix_timestamp
β Unix epoch secondshuman_readable
β Friendly display format
custom_formats
β Your strftime formatscomponents
β Broken down date partsinput_locale_detected
β Detected languageinput_original
β Your original input
Basic Examples
Parse a simple date string in ISO format
curl "http://127.0.0.1:8000/parse?input=2025-08-09"
Same as above but via POST with JSON body
curl -X POST "http://127.0.0.1:8000/parse" \ -H "Content-Type: application/json" \ -d '{"input":"2025-08-09"}'
Parse with input timezone and convert to different output timezone
curl "http://127.0.0.1:8000/parse?input=2025-08-09%2014:00&input_timezone=Asia/Kolkata&output_timezone=UTC"
Parse relative English phrases
curl "http://127.0.0.1:8000/parse?input=next%20monday%208am"
Parse Spanish phrases with locale specification
curl "http://127.0.0.1:8000/parse?input=maΓ±ana%205pm&locale=es"
Parse Unix epoch (10 digits = seconds, 13 digits = milliseconds)
curl "http://127.0.0.1:8000/parse?input=1733808000"
Advanced Examples
Return multiple custom formatted strings
curl -X POST "http://127.0.0.1:8000/parse" \ -H "Content-Type: application/json" \ -d '{"input":"2025-08-09 14:00","output_formats":["%Y-%m-%d","%A","%B %d, %Y at %I:%M %p"]}'
Demonstrates all major parameters in one request
curl -X POST "http://127.0.0.1:8000/parse" \ -H "Content-Type: application/json" \ -d '{"input":"next friday 6pm","locale":"en","input_timezone":"Europe/London","output_timezone":"Asia/Kolkata","output_formats":["%Y-%m-%d","%H:%M %p"]}'
Parse ISO datetime with timezone offset and convert
curl "http://127.0.0.1:8000/parse?input=2025-08-09T14:30:00%2B05:30&output_timezone=UTC"
Error Codes
All errors return with HTTP 400
and follow this structure:
{"success": false, "error_code": "ERROR_CODE", "message": "Human readable message", "input_original": "user_input"}
The input string couldn't be parsed as a valid date/time by any method
The specified timezone is not recognized or invalid
Timezone abbreviation matches multiple zones (e.g., CST could be Central Standard Time in US or China)
You've exceeded the allowed request rate for your IP address
Unexpected server-side error during processing
One or more of the provided strftime format strings is invalid
Rate Limits
Why These Limits?
Date parsing involves complex natural language processing and timezone calculations. These limits ensure:
- Fair usage β Prevents individual users from overwhelming the service
- Performance β Maintains sub-200ms response times for all users
- Resource efficiency β Allows the API to handle high-quality parsing without degradation
- Abuse prevention β Stops automated scraping or excessive polling
Rate limits are applied per IP address.
π Hosted on Railway
This API is currently hosted on Railway's free tier, which comes with resource limitations. The current rate limits help ensure the service stays available for everyone within these constraints.
Your donations help cover server costs and allow me to upgrade to higher limits and dedicated infrastructure. Every coffee makes a difference! π