Time & Calendar
Intermediate

Unix Timestamp

Seconds elapsed since 1970-01-01 00:00:00 UTC (the epoch).

Formula

t=86400 d+3600h+60m+st = 86400\,d + 3600h + 60m + s

Variables

dWhole days since epoch
h,m,sHour, minute, second

Example

2001-09-09 01:46:40 UTC ⇒ t = 1,000,000,000

How it works

A Unix timestamp counts how many seconds have passed since midnight at the start of 1970-01-01 in Coordinated Universal Time (UTC). The formula works by splitting elapsed time into whole days, hours, minutes, and seconds, then converting each part into seconds and adding them together: 1 day = 86,400 seconds, 1 hour = 3,600 seconds, and 1 minute = 60 seconds. This gives one single number that computers can compare, store, and sort easily.

When to use it

Use this when you need to convert a date and time into a machine-friendly numeric value, such as in programming, logs, databases, or scheduling systems. It is also useful for finding time differences between two UTC moments by subtracting their timestamps.

Worked example, step by step

Find the Unix timestamp for 1970-01-02 03:04:05 UTC. Here, d = 1, h = 3, m = 4, s = 5 Substitute into the formula: t = 86400d + 3600h + 60m + s t = 86400(1) + 3600(3) + 60(4) + 5 t = 86400 + 10800 + 240 + 5 t = 97445 So the Unix timestamp is 97,445 seconds.

Common mistakes to avoid

  • Using local time instead of UTC
  • Forgetting that whole days contribute 86,400 seconds each
  • Treating months or years as fixed-length units in the formula

Did You Know?

A 32-bit signed timestamp overflows on 2038-01-19 — the looming "Year 2038 problem".

Share this formula

Reviewed & maintained by the FormulaWon editorial teamLast reviewed September 2026