Unix Time in Seconds

Current Unix Time
Advertisement

Unix Time in Seconds

Unix time in seconds is the standard representation: a 10-digit integer counting the seconds elapsed since January 1, 1970, 00:00:00 UTC. This is the "classic" Unix timestamp format, used by default in Python, PHP, Go, Ruby, C, Bash, and most SQL databases. The current value is shown live at the top of this page.

Unix time in seconds is called a 10-digit timestamp because it will remain 10 digits until November 20, 2286, when it becomes 11 digits. The maximum value representable by a 32-bit signed integer is 2,147,483,647, which corresponds to January 19, 2038 — this is the source of the Year 2038 Problem for legacy systems. All modern systems use 64-bit integers, which extend the range to the year 292 billion.

Conversion factors for seconds

1 minute = 60 seconds
1 hour = 3,600 seconds
1 day = 86,400 seconds
1 week = 604,800 seconds
1 month (avg) ≈ 2,629,800 seconds
1 year (non-leap) = 31,536,000 seconds
1 year (leap) = 31,622,400 seconds

Unix time in seconds: code examples

Get current Unix time in seconds:
Python: int(time.time())
JavaScript: Math.floor(Date.now() / 1000)
PHP: time()
Go: time.Now().Unix()
Bash: date +%s

Convert seconds to milliseconds: multiply by 1000
Convert milliseconds to seconds: integer-divide by 1000

Use the seconds-to-duration converter (section 4 on this page) to break down any number of seconds into years, months, days, hours, and minutes.

Advertisement
// Epoch → Human-readable date

Auto-detects seconds (10 digits), milliseconds (13), microseconds (16), nanoseconds (19)

Invalid timestamp. Please enter a numeric Unix timestamp.
// Date → Epoch timestamp
Please check the values — year (1970–9999), month (1–12), day (1–31), hour (0–23), min/sec (0–59).

Or paste a date string:

Could not parse that date string.
Advertisement

← Back to all tools

Copied!