Unix epoch day number

Useful for developers and data analysts who store dates as day counts, as the Parquet DATE type and some databases do.

Loading the tool…

Processing and privacy: The result is calculated inside your browser and your data is not sent to any server.

How to use it

  1. Enter date.
  2. The result appears straight away and updates as you edit.
  3. Copy the result, or copy a link that keeps the same values to share it.

How it is calculated

Day number = days from 1970-01-01 to the date, negative before 1970. Timestamp in seconds = day number × 86400, in milliseconds = day number × 86400000.

Example

Inputs: Date = 2000-01-01. Result: Day number since 1970-01-01: 10,957; Weekday: Saturday.

Limits and caveats

  • The timestamp is for the start of the day in UTC, not your local time.
  • Unix time ignores leap seconds, as the standard itself does.

Questions about this tool

What is the Unix epoch day number?

The count of whole days since 1 January 1970, so 1 January 2000 is day 10957.

Why is the number sometimes negative?

Dates before 1970 sit before day zero, so 31 December 1969 is day -1.

How do I get the date back from the day number?

Multiply it by 86400000 for milliseconds, pass that to new Date in JavaScript and read the date in UTC.