Skip to content

All tools (41)

JSON 6
Time & Date 4
Encoding & Decoding 4
Generators 3
Text & Data 4
Logs & Debugging 1
Config & Infra 3
Security & Hashing 4
Color & Design 5
Numbers & Bits 3
Web & Markup 4

Nothing leaves the cave.

Nothing you paste ever leaves your device. There is no server to send it to.

How you can check →
DevToolsCave

    This tool runs entirely in your browser. Nothing you paste is uploaded.

    How you can check →

    Epoch Converter

    Time & Date

    Convert Unix/epoch timestamps to human-readable dates, and dates back to timestamps — instantly, entirely in your browser.

    Current Unix time (seconds)

    Paste anything that might be a moment in time

    A Unix timestamp in seconds, milliseconds, microseconds or nanoseconds; an ISO 8601 date; an HTTP date; or a SQL DATETIME. We'll say what we think it is and why — and never quietly pick for you if there's a real alternative.

    Local time
    Chosen zone
    UTC
    ISO 8601
    Relative
    More formats & calendar facts
    RFC 1123 / RFC 2822 (HTTP date)
    RFC 3339 (chosen zone)
    SQL DATETIME (chosen zone)
    Hex (Unix seconds)
    Weekday
    ISO week
    Day of year
    Quarter

    Time zone for this page

    Drives both the "Chosen zone" output above and how Date → Timestamp below is interpreted.

    Currently:

    Date → Timestamp

    Interpreted in the zone above (local).

    What is Unix time?

    Unix time (also called epoch time or POSIX time) counts the number of seconds that have elapsed since 00:00:00 UTC on January 1, 1970, ignoring leap seconds. It's the standard way most operating systems, programming languages, databases, and APIs represent a point in time internally — as a single number rather than a formatted string.

    Why use a timestamp instead of a date string?

    A timestamp is timezone-independent, sorts numerically, and is trivial to do arithmetic on (e.g. "is this token expired?" or "how many days between these two events?"). Formatted date strings only enter the picture when you need to display a timestamp to a human — and that's exactly what this tool converts between.

    Local time isn't always one answer

    Twice a year, clocks in most zones that observe daylight saving time either skip an hour or repeat one. A local time inside the skipped hour never happened, and a local time inside the repeated hour happened twice — at two different instants, an hour apart. Rather than silently guess which one you mean (or invent an instant that never occurred), this tool tells you which case you're in and, for a repeated hour, shows both instants with their own UTC offsets.

    Common use cases

    • Debugging API responses or database rows that store created_at as an epoch integer
    • Checking a JWT's exp/iat claims (see the JWT decoder)
    • Converting log timestamps to your local timezone — and, once decoded, checking what that moment was for a colleague elsewhere with the world clock and time zone converter
    • Scheduling or cache-expiry calculations
    • Pasting a column of timestamps from a log file or spreadsheet to convert them all at once, with a CSV you can drop straight back into a spreadsheet
    • Turning a decoded timestamp into a string your code can print — the date format generator gives you the exact format string for Python, Java, C#, Go, PHP or SQL
    • Deciding whether a value is really a moment in time, or a "0"/"-1"/"never expires" sentinel in disguise
    • Working out what a Snowflake ID, MongoDB ObjectId, ULID or UUID v7/v1 was generated at
    • Making sense of an Excel serial date, a Windows FILETIME, or a .NET Ticks value
    • Computing a date range for a query — start/end of day, week, month, quarter or year, DST-aware

    Why 10 digits, or 13, or 19?

    A 10-digit value is almost always seconds since the epoch (Unix/Linux, most APIs, most databases). 13 digits is almost always milliseconds (JavaScript's Date.now(), many web APIs). 16 is microseconds, and 19 is nanoseconds (Go's UnixNano(), ClickHouse, InfluxDB, OpenTelemetry). Digit count is a strong prior, not a guarantee — a pre-1970 or far-future value breaks the pattern, and this tool checks the implied year rather than trusting width alone, showing every unit as a one-click alternate so you can correct it in one click if the guess is wrong. Under the hood, every unit conversion runs on BigInt rather than JavaScript's Number, which starts losing precision above 253 — so a 19-digit nanosecond value comes back exact instead of silently rounded to the nearest few hundred nanoseconds, which is what a naive Number()-based converter does.

    The Year 2038 problem

    Systems that store a Unix timestamp in a signed 32-bit integer (the C time_t on many older or embedded systems) run out of room at 2147483647, which is 2038-01-19T03:14:07 UTC. One second later the value overflows and wraps to a large negative number — 1901, not 2038, on an unpatched system. Nearly everything built in the last decade uses a 64-bit time_t and is unaffected, but 32-bit embedded devices, old databases and some file formats still aren't. This tool flags 2147483647 and values near −2147483648 automatically, since a value in that second range usually means "this already overflowed."

    IDs that secretly carry a timestamp

    Several widely-used ID formats encode the moment they were generated directly in the ID, no separate column required. A Snowflake ID (Discord, Twitter/X and several other platforms) packs milliseconds-since-a-platform-epoch into its top bits. A MongoDB ObjectId's first 4 bytes are epoch seconds. A ULID and a UUID v7 both encode 48-bit milliseconds in their first 10/12 characters — that's the whole point of the newer UUID versions, sortable-by-creation-time IDs. An older UUID v1 carries a 60-bit count of 100-nanosecond intervals since 1582. Paste any of these into the converter above and it decodes automatically.

    Time math: adding, subtracting and date ranges

    The Time math tab turns a resolved instant into answers you can act on: add or subtract a duration (years, months, days, hours, minutes, seconds), find the signed difference between two timestamps as both seconds and a human breakdown, and get the start/end epoch of a day, week, month, quarter or year — the pair a WHERE created_at BETWEEN start AND end query actually needs. Calendar units (years, months, days) step the wall-clock date and re-resolve in your chosen time zone, so adding "one day" across a daylight-saving change correctly comes out to 23 or 25 real hours, not a naive +86,400,000 milliseconds.

    Code snippets, both directions, in real languages

    The Formats & code tab prints runnable code — not a simulated result — for parsing a Unix timestamp, formatting one, and getting the current time in Python, JavaScript, Java, C#, Go, PHP, Ruby, Rust, SQL (PostgreSQL, MySQL, SQL Server, SQLite), shell, PowerShell and Excel. Every language's snippet is anchored to the same example instant, so you can copy the one you need or compare two languages line for line.

    Foreign epochs

    Not every system counts from 1970. Windows' FILETIME (and LDAP timestamps) count 100ns intervals from 1601. .NET's DateTime.Ticks does the same from year 1. Excel stores dates as a day count from 1899-12-30 — the number behind that "45678" a CSV import sometimes shows instead of a date. Apple's Cocoa/Core Data, classic Mac HFS+, NTP, GPS time and the astronomical Julian Day all use their own base date and unit too. The Formats & code tab converts the resolved instant into every one of these, and the Reference tab lists the base date and unit for each.

    Frequently asked questions

    What is a Unix/epoch timestamp?
    It's the number of seconds (or milliseconds) that have elapsed since 00:00:00 UTC on January 1, 1970 — the 'Unix epoch'. Computers store dates this way because it's a single, unambiguous number that's easy to compare and do math on.
    Why do some timestamps have 10 digits and others 13?
    10 digits usually means seconds since the epoch (used by Unix/Linux, most APIs, and databases). 13 digits usually means milliseconds (used by JavaScript's Date.now() and many web APIs). This tool lets you pick either.
    Does a Unix timestamp include a timezone?
    No — a Unix timestamp always represents a single, absolute instant in UTC. Timezones only come into play when you format that instant into a human-readable string, which is why this tool shows both your local time and UTC, plus a picker for any other zone.
    What happens if I ask for a local time that doesn't exist, like during a DST change?
    Clocks skip an hour on the 'spring forward' day, so a time like 02:30 genuinely never happens in some zones on that date. Rather than silently pick a nearby instant, this tool tells you the local time doesn't exist and shows the gap. On the 'fall back' day, the opposite happens — a hour repeats — so the same local time refers to two different instants, and this tool shows both.
    What happens in 2038?
    Systems that store epoch seconds in a signed 32-bit integer will overflow on January 19, 2038 (the 'Year 2038 problem'). Most modern systems use 64-bit integers and aren't affected.
    Can this decode a Snowflake ID, MongoDB ObjectId, ULID or UUID?
    Yes — paste any of them into the box above and the tool recognises the shape automatically: a MongoDB ObjectId's first 4 bytes, a ULID or UUID v7's first 48 bits, a UUID v1's 100-nanosecond tick count, or a Discord-style Snowflake's top bits are all decoded into the moment they encode.
    What does it mean when the tool flags a value as a sentinel?
    Some numbers are almost never a real moment in time — 0 and -1 usually mean 'unset', 2147483647 is the instant a 32-bit signed timestamp overflows, and 253402300799 (year 9999) is a common 'never expires' placeholder. The tool names these instead of showing a confident-looking date that doesn't mean what it appears to.
    Does it handle nanosecond and microsecond timestamps accurately?
    Yes, exactly — the conversion engine uses BigInt end to end instead of JavaScript's Number type. Number can only represent integers exactly up to 2^53 (9,007,199,254,740,991), so a 19-digit nanosecond timestamp like Go's UnixNano() or a ClickHouse/InfluxDB/OpenTelemetry value silently loses its last few digits in most converters. This one doesn't, and it tells you when a conversion (like nanoseconds down to milliseconds) is inherently lossy rather than staying silent about it.
    Can I add or subtract time from a timestamp, or find the difference between two?
    Yes — the Time math tab adds or subtracts years, months, days, hours, minutes and seconds from any resolved instant, and computes the signed difference between two timestamps. Years, months and days step the calendar date and re-resolve against your chosen time zone, so adding a day across a daylight-saving change is correctly 23 or 25 real hours, not a blind +86,400,000ms. The same tab also gives you the start and end epoch of a day, week, month, quarter or year — the exact pair a SQL WHERE ts BETWEEN … clause needs.
    Does this tool give me code to convert timestamps in my own language?
    Yes — the Formats & code tab has real, runnable snippets for parsing an epoch timestamp, formatting it, and getting the current time, in Python, JavaScript, Java, C#, Go, PHP, Ruby, Rust, SQL (Postgres, MySQL, SQL Server, SQLite), shell, PowerShell and Excel. Every snippet uses the same example instant so you can compare two languages line for line, and nothing is simulated — it's code you can paste and run.
    Can it convert to and from Windows FILETIME, .NET Ticks, Excel dates or other non-Unix epochs?
    Yes — the Formats & code tab converts the resolved instant into Windows FILETIME/LDAP time, .NET DateTime.Ticks, Chrome/WebKit time, Excel's OLE Automation date (the '45678' a CSV import sometimes shows instead of a date), Cocoa/Core Data time, Mac HFS+ time, NTP time, GPS time and the astronomical Julian Day — each format's base date and unit is listed on the Reference tab.

    Last updated .