complete.tools

Unix Timestamp Converter

Convert between Unix timestamps and calendar dates in UTC, in seconds or milliseconds.

What this tool does

Convert between Unix timestamps and calendar dates in UTC, in seconds or milliseconds. You fill in these fields: Convert. Some fields appear only for certain choices. Some fields are optional. It shows date and time (UTC), unix timestamp (seconds), weekday, date, seconds, and milliseconds.

Inputs

  • Convert: Switch between: Timestamp to date, Date to timestamp.
  • Timestamp unit: Switch between: Seconds, Milliseconds. Shown only when "Convert" is Timestamp to date.
  • Timestamp: A whole number. Accepts -62,135,596,800,000 to 253,402,300,799,999. Shown only when "Convert" is Timestamp to date. Whole seconds, or milliseconds if you chose that unit, since 1970-01-01 00:00:00 UTC.
  • Date (UTC): A date. Shown only when "Convert" is Date to timestamp.
  • Time (UTC): Text, up to 200 characters. Shown only when "Convert" is Date to timestamp. Optional. 24-hour time as HH:MM or HH:MM:SS. Left empty it means midnight.

How to use

  1. Choose Timestamp to date or Date to timestamp for "Convert".
  2. If "Convert" is Timestamp to date, choose Seconds or Milliseconds for "Timestamp unit".
  3. If "Convert" is Timestamp to date, enter the timestamp.
  4. If "Convert" is Date to timestamp, pick a date for "Date (UTC)".
  5. If "Convert" is Date to timestamp, type the time (UTC). This one is optional.
  6. Read the result: date and time (UTC), unix timestamp (seconds), weekday, date, seconds, and milliseconds. It appears once every required field has a valid value.

Worked examples

Example 1. Inputs:

  • Convert: Timestamp to date
  • Timestamp unit: Seconds
  • Timestamp: 0

Results:

  • Date and time (UTC): 1970-01-01T00:00:00Z
  • Weekday: Thursday
  • Date: Thursday, January 1, 1970
  • Seconds: 0
  • Milliseconds: 0

How this is worked out: POSIX epoch definition: timestamp 0 is 1970-01-01 00:00:00 UTC, which was a Thursday.

Example 2. Inputs:

  • Convert: Timestamp to date
  • Timestamp unit: Milliseconds
  • Timestamp: 1,672,531,200,000

Results:

  • Date and time (UTC): 2023-01-01T00:00:00Z
  • Weekday: Sunday
  • Date: Sunday, January 1, 2023
  • Seconds: 1672531200
  • Milliseconds: 1672531200000

How this is worked out: 1672531200000 ms / 1000 = 1672531200 s. 1672531200 / 86400 = 19358 days exactly: 53 years x 365 = 19345 plus 13 leap days (1972 to 2020) = 19358, which is 2023-01-01. 19358 = 7 x 2765 + 3, Thursday + 3 = Sunday.

Example 3. Inputs:

  • Convert: Date to timestamp
  • Date (UTC): January 1, 2000
  • Time (UTC): "12:00:00"

Results:

  • Unix timestamp (seconds): 946728000
  • Weekday: Saturday
  • Date: Saturday, January 1, 2000
  • Seconds: 946728000
  • Milliseconds: 946728000000

How this is worked out: 1970-01-01 to 2000-01-01 is 30 x 365 + 7 leap days (1972 to 1996) = 10957 days. 10957 x 86400 = 946,684,800. Plus 12 h = 43,200 s gives 946,728,000.

Example 4. Inputs:

  • Convert: Date to timestamp
  • Date (UTC): December 31, 1969
  • Time (UTC): "23:59:59"

Results:

  • Unix timestamp (seconds): -1
  • Weekday: Wednesday
  • Date: Wednesday, December 31, 1969
  • Seconds: -1
  • Milliseconds: -1000

How this is worked out: Reviewer: the last second of 1969 is one second before the epoch, so -1.

Limitations

  • All dates and times are UTC. Time zones and daylight saving are not applied.
  • Leap seconds are ignored, as in the standard Unix definition.
  • Years 1 to 9999 only, using the Gregorian calendar.
  • A millisecond timestamp is shown to the whole second. The part below a second is dropped from the date and time.
  • It does not show the current time.

FAQs

Q: What is a Unix timestamp?
A: It is the number of seconds that have passed since 00:00:00 UTC on 1 January 1970, ignoring leap seconds.
Q: Are the dates in my time zone?
A: No. Every date and time here is UTC. Convert to your own time zone separately if you need local time.
Q: How do I tell seconds from milliseconds?
A: A 10-digit timestamp is usually seconds and a 13-digit one is usually milliseconds. Choose the matching unit before you enter it.
Q: Can it handle dates before 1970?
A: Yes. Dates before 1 January 1970 give negative timestamps, and negative timestamps are accepted.

Explore Similar Tools

Explore more tools like this one: