Current Unix timestamp (seconds)

About the Timestamp / Unix Time Converter

A Unix timestamp is the number of seconds elapsed since 00:00:00 UTC on 1 January 1970 — the Unix epoch. It is the standard time representation in databases, APIs, log files, and server-side code because it is a single integer: timezone-independent, sort-friendly, and easy to do arithmetic on. JavaScript uses millisecond timestamps (13 digits); most Unix systems use second-precision (10 digits).

Common timestamp formats

The Year 2038 problem

32-bit signed integers overflow on 19 January 2038 at 03:14:07 UTC. Modern 64-bit systems extend the range to the year 292 billion. If you work with embedded systems or legacy 32-bit databases, this is a real concern to address before 2038.

Working with timestamps in different databases

Different databases store and query timestamps differently. PostgreSQL's TIMESTAMPTZ stores UTC and converts to session timezone for display. MySQL TIMESTAMP stores UTC (max value: 2038-01-19); DATETIME stores local time with no timezone awareness. MongoDB stores ISODate() values as 64-bit UTC milliseconds. Always use timezone-aware types in production.

Frequently Asked Questions

What is a Unix timestamp?
A Unix timestamp is the number of seconds since 00:00:00 UTC on 1 January 1970. It is timezone-independent: the same integer represents the same moment everywhere. JavaScript uses milliseconds (multiply seconds by 1000); Python and most Unix tools use whole seconds.
How do I convert a Unix timestamp to a readable date?
JavaScript: new Date(timestamp * 1000).toISOString() (multiply by 1000 if the timestamp is in seconds). Python: from datetime import datetime; datetime.utcfromtimestamp(ts). Terminal: date -d @1748822400 (Linux) or date -r 1748822400 (Mac).
What is the difference between Unix seconds and milliseconds?
Both count from the same epoch (1 Jan 1970 UTC). Unix seconds is a 10-digit integer; Unix milliseconds is a 13-digit integer (multiply seconds by 1000). JavaScript Date.now() returns milliseconds. Python time.time() returns seconds as a float. Always verify which unit an API expects.
What is ISO 8601 format?
ISO 8601 is the international standard for dates and times: YYYY-MM-DDTHH:MM:SSZ where T separates date and time, and Z denotes UTC. Example: 2025-06-01T14:30:00Z. It is unambiguous, lexicographically sortable, and the recommended format for REST API responses and JSON payloads.
How do I get the current Unix timestamp?
JavaScript: Math.floor(Date.now() / 1000) for seconds, or Date.now() for milliseconds. Python: import time; int(time.time()). PHP: time(). Bash: date +%s. PostgreSQL: SELECT EXTRACT(EPOCH FROM NOW()).
Related tools
Ad