LazyTools Header
Unix Timestamp to Date Converter — Seconds, Negative & Batch | LazyTools
Developer Tool

Unix Timestamp to Date Converter — Seconds, Negative & Batch

Convert Unix timestamps (in seconds) to readable dates and times — and any date back to its Unix timestamp. The tool shows the UTC date, an optional timezone-adjusted time, relative time ("3 days ago"), ISO 8601 format and milliseconds. Furthermore, negative timestamps (dates before 1 January 1970) are supported — useful for historical data processing. The Batch tab converts up to 300 timestamps at once with relative time for each.

Seconds-based timestampsNegative (pre-1970) supportTimezone adjustmentRelative time displayBatch 300 timestamps

How to use the Unix Timestamp to Date Converter

1
Enter a Unix timestamp in seconds
Type any Unix timestamp in the input field. Furthermore, the tool defaults to the current Unix timestamp — making it immediately useful for testing and verification. Negative values are accepted for dates before 1 January 1970 UTC.
2
Select a timezone offset
Choose the timezone offset to see the local time for a specific region alongside the UTC result. Furthermore, the UAE (UTC+4), India (UTC+5:30), China/Singapore (UTC+8) and US options cover the most common international use cases. The UTC result is always shown for unambiguous reference.
3
Click Convert to Date and Time
The result shows the UTC ISO 8601 format, UTC long form, timezone-adjusted local time, milliseconds, day of week and a relative time string ("X days ago" or "In X days"). Furthermore, individual Copy buttons on each row make it simple to copy any specific format for use in code or documents.
4
Convert a date to timestamp
Click the Date → Timestamp tab. Enter a date and optional UTC time, then click Convert. Furthermore, the result shows the Unix timestamp in seconds, milliseconds and microseconds — all three common variants used across different programming languages and databases.
5
Batch convert a column of timestamps
Click the Batch tab and paste up to 300 Unix timestamps from a database export or log file. Furthermore, clicking Convert All produces a table with the date in your chosen format and a relative time for each timestamp. Copy CSV exports the full result for re-import into spreadsheets.

Unix timestamp formats in common use

Unix timestamps appear in multiple precision levels across different systems. Furthermore, knowing which precision a given timestamp uses is the first step in conversion — a 10-digit number is seconds; 13 digits is milliseconds; 16 digits is microseconds.

FormatDigitsExample (1 Jan 2025 00:00 UTC)Used by
Seconds101735689600POSIX, C, Python time.time(), shell
Milliseconds131735689600000JavaScript Date.now(), Java, Kafka
Microseconds161735689600000000PostgreSQL, Python datetime.timestamp()*1e6
Nanoseconds191735689600000000000Go time.UnixNano(), some IoT systems

Negative Unix timestamps

The Unix epoch is 1 January 1970 00:00:00 UTC. Furthermore, timestamps before this date are negative integers. The timestamp −86400 represents 31 December 1969 00:00:00 UTC. Moreover, many modern systems support negative timestamps — PostgreSQL, Python's datetime module and JavaScript's Date object all handle them correctly. However, 32-bit systems and legacy C code may not support negative timestamps due to integer overflow.

How Unix timestamps work

A Unix timestamp counts the number of seconds elapsed since the Unix epoch — 1 January 1970 00:00:00 UTC. Furthermore, this is a continuous count that never resets and ignores leap seconds. The result is a language-agnostic, timezone-agnostic integer that uniquely identifies any moment in time.

Date = Unix epoch (1970-01-01T00:00:00Z) + timestamp × 1 second
Seconds since epoch = Unix timestamp
Milliseconds = Unix timestamp × 1,000
Microseconds = Unix timestamp × 1,000,000
Negative timestamps = dates before 1 January 1970 UTC

The Year 2038 problem

On 32-bit systems, the Unix timestamp is stored as a signed 32-bit integer — which overflows on 19 January 2038 at 03:14:07 UTC (timestamp 2,147,483,647). Furthermore, after this moment, 32-bit systems wrap around to the most negative 32-bit integer — representing 13 December 1901. This "Year 2038 problem" affects legacy embedded systems, IoT devices and old C code. Moreover, 64-bit systems extend the valid range to the year 292,277,026,596 CE — effectively solving the problem for modern software.

Worked example: reading a server log timestamp

A server log shows an error at Unix timestamp 1735689600. A developer needs to know when this occurred and how long ago it was.

FieldValue
Unix timestamp1735689600
UTC ISO 86012025-01-01T00:00:00Z
UTC long form1 January 2025 00:00:00 UTC
UAE local time (UTC+4)1 January 2025 04:00:00 GST
Milliseconds1735689600000
Unix timestamp 1735689600 = 1 January 2025 00:00:00 UTC — the exact start of 2025 CE. Furthermore, the UAE local time shows 04:00 on 1 January — 4 hours ahead of UTC. The Batch tab can process an entire log file column of timestamps simultaneously.

What is a Unix timestamp?

A Unix timestamp (also called POSIX time or epoch time) counts seconds elapsed since 1 January 1970 00:00:00 UTC. Furthermore, it is the most widely used machine-readable time format in software engineering. Operating systems, databases, log files, APIs and networking protocols all use Unix timestamps as a universal time representation.

The Unix timestamp's key strength is its simplicity. Furthermore, it is a single integer — timezone-agnostic, language-agnostic and platform-agnostic. Any two systems anywhere in the world that record the same Unix timestamp have recorded the exact same moment in time. Moreover, arithmetic on Unix timestamps is trivial: subtracting two timestamps gives elapsed time in seconds, without any month or year boundary calculation required.

Unix timestamps in databases and APIs

Most SQL databases offer timestamp conversion functions — PostgreSQL's to_timestamp(), MySQL's FROM_UNIXTIME() and SQLite's datetime(). Furthermore, REST APIs commonly return timestamps as Unix integers in JSON responses. Moreover, log aggregation systems like Elasticsearch and Splunk accept Unix timestamps for time-based querying. Understanding Unix timestamps is a fundamental skill for any developer or data engineer working with time-series data.

Why Unix timestamp conversion matters

Server logs, database exports and API responses frequently contain Unix timestamps that humans cannot read directly. Furthermore, debugging production incidents requires quickly converting timestamps from log entries to understand when errors occurred and in what order. Moreover, the relative time display ("3 days ago") immediately contextualises the severity of an issue in an incident postmortem.

Data analysts working with time-series data often receive CSV exports from databases with Unix timestamp columns. Furthermore, converting these to human-readable dates before analysis — or after transformation — is a routine preprocessing step. Moreover, the batch converter reduces this from a manual formula-writing task in Excel to a 10-second paste-and-convert operation.

The importance of timezone awareness

Unix timestamps are always in UTC — timezone is not encoded in the timestamp. Furthermore, displaying a timestamp as a human-readable date requires specifying a timezone offset. A Unix timestamp representing noon UTC becomes different clock times in different regions — 16:00 UAE time, 17:30 India time, 20:00 Singapore time. Moreover, bugs caused by mismatched timezone assumptions are among the most common sources of date-related defects in software systems.

Frequently asked questions

The tool defaults to the current Unix timestamp on load. Furthermore, you can also get it with one command in most programming languages: Python: int(time.time()), JavaScript: Math.floor(Date.now()/1000), bash: date +%s. The current timestamp increments by 1 every second and is currently in the 1.7 billion range for dates in 2025 CE.
A negative Unix timestamp represents a date before the Unix epoch of 1 January 1970 00:00:00 UTC. Furthermore, the timestamp −86400 represents 31 December 1969 00:00:00 UTC — exactly 86,400 seconds (one day) before the epoch. Negative timestamps are valid in most modern 64-bit systems and languages. However, legacy 32-bit C code and some embedded systems may not handle negative timestamps correctly.
Unix timestamps in seconds are 10-digit integers (e.g. 1,735,689,600 for 1 Jan 2025). Furthermore, Unix milliseconds are the same value multiplied by 1,000 — giving a 13-digit integer (e.g. 1,735,689,600,000). JavaScript's Date.now() returns milliseconds; Python's time.time() returns seconds as a float. Moreover, you can identify which unit a timestamp uses by its digit count: 10 digits = seconds, 13 digits = milliseconds, 16 digits = microseconds.
On 32-bit systems storing Unix timestamps as signed 32-bit integers, the maximum value is 2,147,483,647 — corresponding to 19 January 2038 at 03:14:07 UTC. Furthermore, one second after this, the counter overflows to the most negative 32-bit integer, representing 13 December 1901. This "Year 2038 problem" affects legacy embedded systems, old IoT devices and C code using the time_t type. Moreover, 64-bit systems extend the valid range to the year 292 billion CE, effectively solving the problem for all modern software.
Each major database has its own function. PostgreSQL: SELECT to_timestamp(1735689600); MySQL: SELECT FROM_UNIXTIME(1735689600); SQLite: SELECT datetime(1735689600, 'unixepoch'); SQL Server: SELECT DATEADD(second, 1735689600, '1970-01-01'). Furthermore, to get the current Unix timestamp in SQL: PostgreSQL: EXTRACT(EPOCH FROM NOW())::bigint; MySQL: UNIX_TIMESTAMP(); SQLite: strftime('%s', 'now'). Moreover, remember that SQL datetime functions are typically timezone-aware — verify your session timezone when converting.

Related Date & Time tools

Every tool on LazyTools runs in your browser. Nothing is uploaded or stored.

Milliseconds to Date Converter

Convert millisecond timestamps to dates. Furthermore, a duration calculator shows elapsed time between two timestamps.

Excel Serial Date Converter

Convert Excel serial dates. Furthermore, batch mode converts 500 serial numbers at once with CSV export.

Julian Day Number Converter

Convert dates to astronomical Julian Day Numbers. Furthermore, code snippets for Python, JavaScript, SQL and Excel are included.

Online Date Format Converter

Convert dates between ISO, US, EU and 12 other formats. Furthermore, batch mode converts 100 dates at once.

Date Difference Calculator

Calculate exact gaps between two dates. Furthermore, milestone markers show every 100th and 1000th day automatically.

World Clock

See the current time in major cities worldwide. Furthermore, Gulf and Middle East city defaults are included.

Rate this tool

4.2
out of 5
301 ratings
5 ★
60%
4 ★
22%
3 ★
6%
2 ★
2%
1 ★
10%
How useful was this tool?