Unix Timestamp
Seconds elapsed since 1970-01-01 00:00:00 UTC (the epoch).
Formula
Variables
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
More in Time & Calendar
View allLeap Year Rule
BasicTests whether a Gregorian year has 366 days.
Clock Hand Angle
BasicAngle between the hour and minute hands of an analog clock.
Zeller's Congruence
AdvancedFinds the day of the week for any Gregorian date.
Day of the Week from a Birthdate
IntermediateGauss's weekday formula — find which day of the week any birthdate fell on.
Julian Day Number
AdvancedContinuous day count used by astronomers to compare dates.
Days Between Two Dates
IntermediateNumber of days separating two calendar dates.