Date to Epoch Converter

Choose a calendar date, time, and timezone, then convert that local wall-clock time to Unix seconds and milliseconds. Useful for APIs, cron jobs, logs, database rows, and tests.

Convert a human date to Unix time

This page handles the reverse conversion: start with a date, a clock time, and the timezone where that time should be interpreted. The result is a single Unix timestamp that represents the same moment everywhere.

When to use seconds or milliseconds

Use seconds for most backend languages, databases, and command-line tools. Use milliseconds for JavaScript Date, browser APIs, analytics events, and systems that need sub-second precision.

  • Unix seconds are usually 10 digits for modern dates
  • Unix milliseconds are usually 13 digits for modern dates
  • ISO 8601 is best when you want a readable string with explicit UTC output
  • UTC strings are useful for HTTP headers, logs, and quick human checks

Timezone handling

A local date such as 2026-05-14 08:00 means different instants in Los Angeles, New York, London, or Tokyo. Selecting the timezone before conversion avoids off-by-hours mistakes and handles daylight saving time rules through the browser's Intl API.

Choosing the right date boundary

Date-to-epoch conversion is most useful when the calendar meaning is clear before you generate the number. For scheduled jobs, reporting windows, and database filters, decide whether the boundary is UTC or a business timezone first. Then convert that exact wall-clock time to seconds and milliseconds so every service compares the same instant.

  • Use UTC for logs, APIs, CI jobs, and cross-region backend systems
  • Use the business timezone for local billing days, store hours, or user-facing calendars
  • Prefer exclusive upper bounds such as created_at < nextDayStart for date ranges
  • Store the generated timestamp with a short note about the timezone assumption