Timestamp Converter
Enter a timestamp or date to convert.
A Unix timestamp (epoch time) is the number of seconds elapsed since midnight UTC on 1 January 1970. This free online Unix timestamp converter converts epoch seconds or milliseconds to human-readable dates in ISO 8601, UTC, RFC 2822 and local formats — and converts any date string back to a Unix timestamp. Everything runs in your browser.
Unix Timestamp Converter — Epoch to Date & Date to Epoch
How it works
Last updated: November 2026A Unix timestamp is the number of seconds (or milliseconds) elapsed since the Unix epoch — midnight UTC on 1 January 1970. It is the universal language of time for APIs, databases, log files, and operating systems.
- Timestamp → Date: paste a Unix timestamp (seconds or milliseconds — auto-detected) to see it as ISO 8601, UTC, local time, RFC 2822, and relative time ("3 hours ago").
- Date → Timestamp: paste any date string (ISO 8601, natural language, etc.) to get the equivalent Unix timestamp in seconds and milliseconds.
- Live counter in the toolbar shows the current Unix timestamp updating in real time.
Everything runs in your browser using JavaScript's Date object — no data leaves your machine.
Timestamp Reference
| Moment | Unix (seconds) | ISO 8601 |
|---|---|---|
| Unix epoch | 0 | 1970-01-01T00:00:00Z |
| Y2K | 946684800 | 2000-01-01T00:00:00Z |
| Y2K38 overflow | 2147483647 | 2038-01-19T03:14:07Z |
| Year 2100 | 4102444800 | 2100-01-01T00:00:00Z |
| Format | Example |
|---|---|
| ISO 8601 | 2023-11-14T22:13:20.000Z |
| UTC string | Tue, 14 Nov 2023 22:13:20 GMT |
| RFC 2822 | Tue, 14 Nov 2023 22:13:20 +0000 |
| Relative | about 1 year ago |
Tips & Tricks
Always store timestamps in UTC
Storing timestamps in a local timezone is a common source of bugs when servers are in different timezones or when DST changes. Store UTC in your database and convert to local time only at display time in the browser.
Spot seconds vs milliseconds by digit count
A Unix timestamp in seconds is 10 digits (until 2286). In milliseconds it is 13 digits. If you get a date far in the future (like 55,000 CE), you likely passed milliseconds to a function expecting seconds. This tool auto-detects and labels which unit it found.
JWT exp claims are Unix seconds
JWT tokens store their expiry as a Unix timestamp in seconds in the exp claim. To check expiry: exp > Date.now() / 1000. A common bug is comparing exp against Date.now() directly — this returns false for valid tokens because ms > s.
new Date() without 'Z' uses local time
In JavaScript, new Date('2024-01-15T10:30:00') parses as local time in most environments, but new Date('2024-01-15T10:30:00Z') parses as UTC. Always append 'Z' or a timezone offset when constructing dates from strings to avoid ambiguity.
Unix timestamps are timezone-free
A Unix timestamp represents a single absolute moment in time — the same value everywhere on Earth simultaneously. Timezones only matter when converting to or from a human-readable string. Two servers in different timezones calling Date.now() at the same instant return the same value.
Cron jobs run in server local time by default
Standard cron uses the server's local timezone, not UTC. If you schedule a cron job at 02:00 and your server is in a DST timezone, it will skip or double-fire at DST boundaries. Use the Cron Generator to build your expression and always set TZ=UTC in production.
Code Examples
Node.js / JavaScript
// Timestamp to date
const ts = 1700000000; // Unix seconds
const date = new Date(ts * 1000);
console.log(date.toISOString()); // 2023-11-14T22:13:20.000Z
console.log(date.toUTCString()); // Tue, 14 Nov 2023 22:13:20 GMT
// Date to timestamp
const d = new Date('2024-01-15T10:30:00Z');
console.log(Math.floor(d.getTime() / 1000)); // Unix seconds
console.log(d.getTime()); // Unix milliseconds
// Current timestamp
console.log(Math.floor(Date.now() / 1000)); // seconds
console.log(Date.now()); // milliseconds Python
import datetime # Timestamp to date (always use UTC to avoid ambiguity) ts = 1700000000 dt = datetime.datetime.fromtimestamp(ts, tz=datetime.timezone.utc) print(dt.isoformat()) # 2023-11-14T22:13:20+00:00 # Date to timestamp dt2 = datetime.datetime(2024, 1, 15, 10, 30, 0, tzinfo=datetime.timezone.utc) print(int(dt2.timestamp())) # 1705315800 # Current timestamp import time print(int(time.time())) # Unix seconds print(int(time.time() * 1000)) # Unix milliseconds
CLI (macOS / Linux)
# Current timestamp (seconds) date +%s # Timestamp to human-readable (macOS) date -r 1700000000 # Timestamp to human-readable (Linux) date -d @1700000000 # Date to timestamp (macOS) date -j -f "%Y-%m-%d %H:%M:%S" "2024-01-15 10:30:00" +%s # Date to timestamp (Linux) date -d "2024-01-15 10:30:00 UTC" +%s
Frequently Asked Questions
- What is a Unix timestamp?
- A Unix timestamp (also called epoch time or POSIX time) is the number of seconds elapsed since the Unix epoch — midnight UTC on 1 January 1970 (
1970-01-01T00:00:00Z). It represents any moment in time as a single integer, completely timezone-free: the same Unix timestamp value is identical on a server in Tokyo and a laptop in New York at the same instant. For example, the timestamp1700000000corresponds to 2023-11-14T22:13:20Z everywhere on Earth. Unix timestamps are used universally in databases (MySQL TIMESTAMP, PostgreSQL timestamptz, SQLite INTEGER), REST APIs and JSON payloads, server log files, JWT token claims (exp,iat), Unix/Linux system calls (time(2)), and cloud services. Because they are plain integers, timestamps can be compared, sorted, subtracted, and stored in any data type without losing precision — unlike human-readable date strings which are locale-dependent and potentially ambiguous. - What is the difference between seconds and milliseconds timestamps?
- A Unix timestamp in seconds is a 10-digit integer (e.g.
1700000000). The same moment in milliseconds is a 13-digit integer (1700000000000) — exactly 1000x larger. POSIX system calls and most Unix/Linux APIs use seconds (time_t); JavaScript'sDate.now()uses milliseconds; PostgreSQL stores timestamps with microsecond precision internally. Database systems vary widely: MySQL TIMESTAMP and DATETIME use seconds, MongoDB and JavaSystem.currentTimeMillis()use milliseconds. A common bug occurs when a millisecond timestamp is passed to a function expecting seconds — the resulting date will be in the year 55,000+. This tool auto-detects which unit you pasted: a 10-digit number is treated as seconds, a 13-digit number as milliseconds. The detected unit is displayed in the output panel so you can verify the interpretation before copying the result. - What is epoch time?
- Epoch time is another name for Unix time — the count of seconds since
1970-01-01T00:00:00Z. The word "epoch" refers to the fixed reference point (the starting moment) from which elapsed time is measured. The Unix epoch of 1 January 1970 00:00:00 UTC was chosen by the developers of UNIX at AT&T Bell Labs in the early 1970s. Different systems use different epochs: Windows FILETIME measures 100-nanosecond intervals since 1601-01-01 (the start of a Gregorian 400-year cycle); GPS time counts seconds since 1980-01-06; NTP counts seconds since 1900-01-01; Apple's Cocoa framework uses 2001-01-01 as its reference date. The .NETDateTime.ToUnixTimeSeconds()andDateTimeOffset.ToUnixTimeSeconds()methods convert from .NET's internal epoch to Unix time correctly, handling the different reference point automatically. - What is the current Unix timestamp?
- The live counter in the toolbar of this page shows the current Unix timestamp updating every second — click it or use the "Use Now" button to load it into the input. Programmatically: in JavaScript use
Math.floor(Date.now() / 1000)for seconds orDate.now()for milliseconds; in Python useimport time; int(time.time())for seconds orint(time.time() * 1000)for milliseconds; in Bash on Linux rundate +%s; in Go usetime.Now().Unix()(seconds) ortime.Now().UnixMilli()(milliseconds, Go 1.17+); in SQL Server useDATEDIFF(SECOND, '1970-01-01', GETUTCDATE()); in PostgreSQL useEXTRACT(EPOCH FROM NOW()). As of November 2026, the current Unix timestamp is approximately 1,764,000,000 seconds. - What will happen to Unix timestamps in 2038?
- The Year 2038 problem (Y2K38) affects systems that store Unix timestamps as a 32-bit signed integer (
int32_t). The maximum value of a signed 32-bit integer is 2,147,483,647, which corresponds to2038-01-19T03:14:07Z. After that moment, 32-bit systems will overflow to a large negative number, typically rolling back to 1901-12-13. 64-bit systems are completely unaffected — a 64-bit signed integer can represent Unix timestamps until the year 292,277,026,596. Most modern server operating systems (Linux kernel, Windows, macOS) already use 64-bittime_t. Linux switched to 64-bittime_tfor 32-bit ARM targets in kernel 5.6 (released 2020). The main risk areas are embedded systems (IoT devices, industrial controllers, automotive ECUs) with 32-bit chips, and legacy databases or applications that store timestamps as 32-bit integers in their schema. MySQL's TIMESTAMP column type is still limited to the range 1970-01-01 to 2038-01-19 — use DATETIME instead for dates beyond 2038. - How do I convert a Unix timestamp in JavaScript?
new Date(unixSeconds * 1000).toISOString()converts a Unix timestamp in seconds to an ISO 8601 string like'2023-11-14T22:13:20.000Z'. If you already have milliseconds:new Date(unixMs).toISOString(). To convert a date string back to a Unix timestamp in seconds:Math.floor(new Date('2024-01-15T10:30:00Z').getTime() / 1000). Always include theZsuffix in the string passed tonew Date()to force UTC interpretation — omitting it results in local time parsing, which varies by environment. For formatting beyond ISO 8601, use theIntl.DateTimeFormatAPI:new Intl.DateTimeFormat('en-US', { timeZone: 'America/New_York', dateStyle: 'full' }).format(new Date(ts * 1000)). Thetemporalproposal (TC39 Stage 3 as of 2024) will replaceDatewith a richer, timezone-aware API; use the@js-temporal/polyfillpackage today.- How do I convert a Unix timestamp in Python?
datetime.datetime.fromtimestamp(ts, tz=datetime.timezone.utc)converts a Unix timestamp in seconds to a UTC-aware datetime object. Always passtz=datetime.timezone.utc— omitting it returns a naive datetime in local time, which is a frequent source of bugs in production. For example,datetime.datetime.fromtimestamp(1700000000, tz=datetime.timezone.utc).isoformat()returns'2023-11-14T22:13:20+00:00'. To convert back:int(dt.timestamp())— this works correctly for both aware and naive datetimes. For other timezones, use thezoneinfomodule (Python 3.9+, stdlib):from zoneinfo import ZoneInfo; dt.astimezone(ZoneInfo('America/New_York')). Avoid the olderpytzlibrary for new code — it uses a deprecated API pattern; usezoneinfoinstead (orpip install tzdataon Windows where IANA timezone data is not bundled with the OS).- What is ISO 8601 format?
- ISO 8601 is the international standard (ISO 8601:2019) for representing date and time. The full format is
YYYY-MM-DDTHH:MM:SS.sssZ, for example2023-11-14T22:13:20.000Z. The 'T' separates the date from the time; 'Z' (Zulu time) means UTC. It is sortable as a plain string — alphabetical sort equals chronological sort — and is unambiguous regardless of locale. It is the recommended format for REST APIs, JSON payloads, database storage, and log files. JSON itself has no native date type, so ISO 8601 strings are the universal convention for expressing timestamps in JSON. Variants of ISO 8601 include date-only (2023-11-14), week date (2023-W46-2), and ordinal date (2023-318). TheZsuffix can be replaced with an offset like+05:30for Indian Standard Time — but always store UTC in your database and apply the offset only at display time. - What is the Unix timestamp for midnight UTC today?
- In JavaScript:
Math.floor(new Date(new Date().toISOString().slice(0,10)+'T00:00:00Z').getTime()/1000). TheZsuffix is critical — it forces UTC interpretation. Without it,new Date('2025-06-15T00:00:00')will be parsed as local time, producing a different result in every timezone. For a specific past or future date:new Date('2025-06-15T00:00:00Z').getTime()/1000. In Python:import datetime; int(datetime.datetime(2025, 6, 15, 0, 0, 0, tzinfo=datetime.timezone.utc).timestamp()). In PostgreSQL:SELECT EXTRACT(EPOCH FROM '2025-06-15 00:00:00 UTC'::timestamptz). In MySQL:SELECT UNIX_TIMESTAMP('2025-06-15 00:00:00')— note that MySQL interprets the string in the server's local timezone, so set the session timezone to UTC first withSET time_zone = '+00:00'if needed. - Why do Unix timestamps ignore leap seconds?
- Unix time counts every day as exactly 86,400 seconds (one day = 24 × 60 × 60), so leap seconds — which UTC occasionally inserts to keep civil time aligned with Earth's rotation — are not represented. In practice, Unix timestamps "smear" across a leap second by running slightly fast or slow, depending on the implementation (Google uses a linear smear over 24 hours; AWS NTP also smears). As of 2024 there have been 27 leap seconds added since 1972, meaning UTC leads Unix time by 27 seconds. For most web and application development this difference is completely irrelevant. It matters for precision timekeeping systems (GPS, NTP servers, financial trading systems, scientific instruments) where sub-second accuracy is required. The ITU-R Decision of November 2022 resolved to abolish leap seconds by 2035, after which UTC and Unix time will diverge only by the fixed 27-second offset accumulated so far.
- Is my data sent to a server?
- No. All timestamp conversion runs entirely in your browser using JavaScript's built-in
Dateobject — no network request is made when you type a timestamp or date. No data is sent to any server, no inputs are logged, and no account or sign-up is required. DevFormatter is a fully static site hosted on a CDN; there is no backend server processing your inputs. You can verify this by opening your browser's Network tab: no fetch or XHR requests appear when you use the converter. This matters if you are converting timestamps that contain sensitive information — for example, timestamps extracted from internal log files or private JWT tokens. The converter works offline once the page has loaded, so you can safely use it in air-gapped or restricted network environments.
Related Tools
Other free developer tools available on DevFormatter.
Cron Generator
Build cron expressions visually, get human-readable descriptions and preview next run times.
JWT Decoder
Decode JWT tokens and inspect exp, iat and nbf timestamp claims in your browser.
UUID Generator
Generate UUID v4, v7 (time-ordered) and nil UUIDs. Bulk generation, 5 output formats.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes from any text.