Unix Timestamp Converter
Convert epoch values to dates, override the unit, and copy timestamp batches as CSV.
Runs locally in your browser. Nothing is uploaded or sent to a server.
Choose Timestamp → Date and enter a Unix timestamp to see seconds, milliseconds, ISO 8601, UTC, and a selected timezone display. Input unit overrides automatic detection for seconds, milliseconds, microseconds, or nanoseconds. Use Date → Timestamp for a local date, or paste one integer per line into Batch Converter and select Copy as CSV. Conversion calculations run in your browser; displayed dates have millisecond resolution.
Updated
Related Tools
JSON Formatter
Beautify or minify JSON, inspect its structure, and copy or download the result in your browser.
developer-toolsRegex Tester
Inspect JavaScript regex matches, preview replacements, and download repeatable test cases.
developer-toolsBase64 Encode / Decode
Convert text or files, repair Base64 padding, choose charsets, and process separate lines locally.
calculatorsTime Zone Converter
Compare city times, customize working weekdays, and find shared 30-minute meeting slots.
developer-toolsCron Expression Parser
Explain Standard, Quartz, and AWS schedules with field details and up to eight local and UTC run times.
developer-toolsNumber Base Converter
Convert exact integers across bases 2–36 and inspect fixed-width bits without silent truncation.
What is a Unix timestamp and how do you convert it?
A Unix timestamp identifies an instant as seconds since the Unix epoch, 1970-01-01 at midnight UTC. APIs and logs often store scaled versions in milliseconds, microseconds, or nanoseconds. The number alone does not identify its unit, so check the producing system before interpreting it.
Choose Timestamp → Date, enter the number, and confirm Input unit. For one worked example, 86400 with Seconds selected produces 1970-01-02T00:00:00.000Z, one day after the epoch. Read the UTC result first, then select a regional display if needed. Use Now to fill the timestamp input, or watch the live clock for the current seconds value.
Numeric timestamps simplify comparing and sorting events when every value uses the same unit and clock convention. They do not encode the sender's timezone. POSIX time also excludes leap seconds from its count, so it should not be treated as a continuous atomic-time measurement for precision timekeeping. A readable date and its numeric timestamp are complementary views of the same instant.
Why does the Unix epoch start on January 1, 1970?
The epoch is an agreed reference point inherited from Unix, rather than a date calculated from the event being recorded. Early Unix evolved at Bell Labs, and the fixed origin became part of its time interface. The Sixth Edition Unix manual documents seconds measured from this origin. Using an established convention lets separate programs exchange time without negotiating a new starting point.
The date has no astronomical significance for the conversion formula. Changing the epoch would change every stored number while leaving the represented events unchanged. Negative values describe instants before the origin, provided the receiving system supports signed timestamps. Check historical-date handling at the destination: a converter accepting a negative number does not establish that an API or database accepts it too.
What is the year-2038 problem?
A signed 32-bit seconds field reaches its maximum at 2147483647, corresponding to 2038-01-19T03:14:07Z. The next second exceeds that representation. The Linux time manual describes the overflow limitation for narrow time types. This concerns storage and interfaces, rather than a universal end to Unix time.
The converter does not force seconds into a signed 32-bit field. Its own numeric date limits are described below, and dates beyond the overflow boundary remain supported within those limits. When debugging an older system, inspect the database column, serialized field, operating-system interface, and consuming application together. A wider type in one layer does not repair truncation elsewhere in the path.
How does ISO 8601 relate to a Unix timestamp?
ISO 8601 expresses calendar dates and times as text; Unix time expresses an instant as a number relative to an epoch. This tool's ISO output comes from JavaScript Date.toISOString() and ends in Z, identifying UTC. The date component, time component, and fractional seconds make that result easier to inspect than a long integer.
Keep an explicit offset when exchanging date strings. A local wall-clock time without a zone may describe different instants in different regions, especially around daylight saving changes. Converting a timestamp to another display timezone changes the calendar representation without changing the underlying instant. For logs, retain the original numeric value and its documented unit alongside a readable UTC string when possible.
How do you get the current timestamp in JavaScript, Python, Go, PHP, and SQL?
The tool's code panel offers language tabs with copyable snippets. These minimal programs print current Unix seconds. JavaScript starts from milliseconds; the other language calls below return seconds directly. SQL syntax depends on the database, so use the query for your engine.
JavaScript
console.log(Math.floor(Date.now() / 1000));
Python
import time
print(int(time.time()))
Go
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println(time.Now().Unix())
}
PHP
<?php
echo time(), PHP_EOL;
SQL
-- MySQL
SELECT UNIX_TIMESTAMP();
-- PostgreSQL: may include fractional seconds
SELECT EXTRACT(EPOCH FROM NOW());
-- SQLite: seconds returned as text
SELECT strftime('%s', 'now');
Confirm the return type as well as the unit when placing these values in JSON or database columns. A fractional SQL result is not the same input format as the integer-only batch field. For elapsed durations inside a process, use a monotonic clock suited to measurement rather than assuming that successive wall-clock readings cannot move backwards.
Which systems produce nanosecond timestamps?
Go exposes epoch nanoseconds through time.Now().UnixNano(). Linux clock_gettime(CLOCK_REALTIME) returns seconds and a nanosecond component. OpenTelemetry's metrics data model also specifies Unix epoch nanoseconds. Resolution describes the representation; it does not guarantee equivalent physical clock accuracy.
Node.js process.hrtime.bigint() measures high-resolution elapsed time from an arbitrary origin, so its value must not be pasted here as epoch nanoseconds. For large epoch integers, retain text or BigInt until reducing the unit. This tool's batch path does that reduction before Number conversion; the single input does not. Neither path retains submillisecond detail in its displayed date.
How does automatic unit detection work?
Automatic detection uses absolute magnitude rather than an exact digit count. Values below 1012 are interpreted as seconds; values below 1015 as milliseconds; values below 1018 as microseconds; larger values as nanoseconds. A negative sign does not change these thresholds. The unit control overrides the guess for both the single-value conversion and the batch.
This heuristic is useful when the magnitude matches the expected unit, but it cannot recover missing context. Small millisecond values near the epoch can be mistaken for seconds. Set the unit from your API specification, database column definition, or log producer. If a date appears unexpectedly far away, verify the unit before changing the timezone.
What precision and date range does the converter support?
The main input converts its text through JavaScript Number. It multiplies seconds by 1,000, keeps milliseconds unchanged, divides microseconds by 1,000, and divides nanoseconds by 1,000,000 before constructing a JavaScript Date. Large integers can round during Number conversion. The displayed date has millisecond resolution; it does not preserve fractional microseconds or nanoseconds.
The batch follows a different path: it reads integer text with BigInt and divides before converting to Number. Division rounds toward negative infinity. Integer parsing preserves the source digits until division, but that does not make the displayed date a nanosecond-precision result. Use this path to avoid rounding the original integer before division, while recognizing that the resulting date still discards submillisecond detail.
Numeric timestamp conversion accepts milliseconds from -62135596800000 through 32503680000000, corresponding to the start of year 0001 through the start of year 3000 in UTC. It rejects numbers outside those bounds. Negative seconds are supported for dates before the epoch. This numeric-input limit should not be confused with the wider theoretical range of JavaScript Date.
Which timezone does a date input use?
Date → Timestamp reads Date & Time as a local date in your browser's timezone. View in timezone: changes the output presentation; it does not change that input interpretation. ISO 8601 output uses UTC with a trailing Z. The UTC and regional displays describe the same instant, so switching between them leaves Unix seconds unchanged.
Compare Timezones displays UTC and lets you pin up to five additional zones, showing regional times and offsets. For a separate UTC-based date input, use Date (UTC) to value in Other Epoch Formats. For focused regional comparisons, open the Time Zone Converter.
How can you convert timestamp batches from logs?
Extract the timestamp column first, then paste one integer per line into Batch Converter. The parser skips blank lines and processes each remaining line independently. Whole log messages, decimal fractions, and multiple comma-separated columns are not accepted as integer timestamp rows. An invalid entry does not stop other rows from converting.
Copy as CSV copies a header and every parsed row, including invalid statuses. The on-page table shows only the first 1,000 rows; that display limit does not truncate the CSV. The selected unit override and display timezone also apply to the batch. If the source is a JSON response, inspect its timestamp field with the JSON Formatter before copying the values.
How does timestamp arithmetic work?
Timestamp Arithmetic adds a signed amount to the result's whole Unix seconds. A minute is 60 seconds, an hour 3,600, a day 86,400, and a week 604,800. The signed amount is applied to the converted instant and the resulting date is shown for inspection. These are fixed durations, so a day here does not mean advancing a regional calendar date across a daylight saving transition.
What is a hex timestamp and when is it useful?
A hex timestamp writes a numeric time value in base sixteen. It is useful when inspecting binary fields or logs that show hexadecimal values; verify the epoch and unit before interpreting a field. The Hex row here represents whole Unix seconds in uppercase hexadecimal, preserving a negative sign instead of forcing an unsigned 32-bit wrap. The result's seconds value is rounded down from milliseconds, so a fractional second can remain visible in ISO output while the seconds and hex rows show whole seconds.
Which other epoch formats can you convert?
Other Epoch Formats handles Windows FILETIME, WebKit timestamps, .NET ticks, Excel serial dates using the 1900 system, and Snowflake IDs with a platform selector. These use different origins or encodings, so select their format rather than treating them as Unix values. FILETIME uses intervals from a different epoch, while Excel uses day counts; neither is a Unix seconds value. Conversion calculations run in the browser; the main timestamp input and conversion direction also synchronize to the page URL.
How to Use Unix Timestamp Converter
-
Conversion Direction
Choose Timestamp → Date to decode a number, or Date → Timestamp to convert a date entered in Date & Time using your browser's local timezone.
-
Unix Timestamp
Enter your number or click Now. For numeric input, use Input unit: to keep Auto-detect or select Seconds (s), Milliseconds (ms), Microseconds (us), or Nanoseconds (ns).
-
View in timezone:
Choose UTC, Browser Local, or a listed region. Read Conversion Result and use its copy buttons for individual values.
-
Batch Converter
Paste one integer timestamp per line. The batch uses the same Input unit: setting and selected timezone. Select Copy as CSV to copy all converted rows, including invalid-row statuses.