Unix Timestamp Converter: Epoch & Date
Convert Unix epoch timestamps to readable dates and back. Supports seconds, milliseconds, ISO 8601, UTC, and local time formats.
What Is Unix Timestamp Converter?
I reach for this tool whenever a server log or database row gives me a raw integer like 1700000000 and I need to know what UTC moment that actually is. Paste a timestamp in seconds or milliseconds and you get ISO 8601, UTC, local time, and a relative string ("3 days ago") in one grid. Or pick a date from the picker to get the timestamp going the other direction. A live counter at the bottom of the page ticks the current Unix timestamp every second.
Key Features
The converter goes both ways: paste a Unix timestamp and you get ISO 8601, UTC, local time, relative time, plus the seconds and milliseconds representations side by side, each row with its own copy button. Or use the datetime-local picker to select a date and time and the timestamp populates immediately in both seconds and milliseconds.
Auto-detection handles the seconds-vs-milliseconds question. Inputs with 10 or fewer digits are read as seconds, 11+ as milliseconds. So 1740000000 is read as seconds (Feb 2025), while 1740000000000 becomes the same moment expressed as milliseconds. JavaScript's Date.now() (13 digits) and Java's System.currentTimeMillis() are detected correctly without any mode toggle.
A persistent card at the bottom of the page shows the current Unix timestamp in both seconds and milliseconds, refreshing every second, with a one-click copy button.
How to Use Unix Timestamp Converter
The left input field, labeled "Unix Timestamp," accepts only digits and a leading minus sign for negative timestamps (dates before January 1, 1970). Type or paste a value such as 1740700800 and the conversion fires on each keystroke — no Submit button. Non-numeric characters are stripped automatically.
To go the other direction, the right field is a datetime-local picker. Selecting a date and time populates the left field with the corresponding Unix timestamp in seconds. Both fields stay in sync — editing one updates the other.
The "Use Now" button reads Date.now() divided by 1,000 (floored to whole seconds) and loads it into the timestamp field. When a valid timestamp or date is entered, a results grid appears with six rows:
| Format | Example output |
|---|---|
| ISO 8601 | 2025-02-28T00:00:00.000Z |
| UTC | Fri, 28 Feb 2025 00:00:00 GMT |
| Local time | 2/28/2025, 7:00:00 PM (varies by locale) |
| Relative time | 2 days ago |
| Timestamp (seconds) | 1740700800 |
| Timestamp (milliseconds) | 1740700800000 |
Each row has a copy button; clicking it shows a "Copied to clipboard" toast. The live counter card below the conversion area shows the current seconds and milliseconds values updating every second, with its own copy button for the seconds value.
Practical Examples
Decoding an API log timestamp
Server log shows "created_at": 1700000000. Paste 1700000000 into the timestamp field. The tool detects 10 digits and treats it as seconds. Result: ISO 2023-11-14T22:13:20.000Z, relative time "14 months ago." No mental arithmetic needed.
Converting a JavaScript Date.now() value
A JavaScript app returns a 13-digit value like 1740700800000. Paste it in. The tool detects milliseconds and shows the same moment as the 10-digit seconds equivalent 1740700800, with both formats displayed side by side.
Building a Unix timestamp for an API call
Need to pass a Unix timestamp for midnight UTC on March 1, 2026. Use the datetime picker to select 2026-03-01T00:00. The timestamp field populates with 1740787200. Copy the seconds value from the results grid into your API request.
Tips and Best Practices
- The auto-detection threshold is 10 digits. Exactly 10 digits is always treated as seconds, which covers all dates from September 9, 2001 through November 20, 2286. Millisecond timestamps from JavaScript or Java land in the 13-digit range and are detected correctly.
- Negative timestamps are supported via a leading minus sign.
-86400corresponds to December 31, 1969 at 00:00:00 UTC, one day before the Unix epoch. - Relative time uses approximate thresholds: under 60 seconds → "X seconds ago/from now"; under 60 minutes → "X minutes"; under 24 hours → "X hours"; under 7 days → "X days"; under 4 weeks → "X weeks"; under 12 months → "X months"; otherwise → "X years."
- The shared URL feature encodes the current timestamp as a query parameter. Send the URL and the recipient sees the same timestamp pre-loaded — useful for pointing a colleague at a specific moment in logs.
- Clicking "Clear" empties both inputs and hides the results grid without refreshing the page.
Common Issues and Troubleshooting
The result grid does not appear after entering a timestamp. The converter parses input with parseInt(value, 10). If the value contains letters, dots, or colons, parseInt may return NaN and the result is hidden. Paste only the raw number; the input field strips non-digit characters except a leading minus sign.
The timestamp converts to an unexpected date. Verify the units. A 10-digit value like 1740000000 is treated as seconds (year 2025). If your system generates milliseconds (13 digits), the same numeric prefix 1740000000 would need three trailing zeros — 1740000000000 — to be interpreted correctly.
The local time format looks wrong. The "Local time" row uses date.toLocaleString(), which respects the device's locale and timezone. Unexpected day/month order reflects your operating system's regional settings, not a conversion error.
Clicking the date input copy button does nothing. That button is disabled (disabled={!dateInput}) until a date is selected. Pick a date first.
The "Use Now" result differs from what I expected. "Use Now" floors Date.now() to whole seconds. The milliseconds precision is intentionally dropped for the seconds-based timestamp. The live counter card below shows both seconds and milliseconds values for millisecond-level precision.
Privacy and Security
All conversions run in your browser's JavaScript runtime. No timestamps, dates, or query parameters are transmitted to any server. The shared URL feature encodes the timestamp as a client-side URL parameter — only people you send the URL to can see it. The tool works offline once the page has loaded, which makes it safe for use with timestamps from internal systems or sensitive application logs.
Frequently Asked Questions
What is a Unix timestamp? A Unix timestamp is the number of seconds (or milliseconds) elapsed since January 1, 1970, 00:00:00 UTC — a reference point called the Unix epoch. It is used widely in programming languages, databases, and APIs because it is a timezone-agnostic integer that is easy to store, compare, and transmit.
How does the auto-detection of seconds vs. milliseconds work? The tool checks the input length. Values with 10 or fewer characters are multiplied by 1,000 before creating a Date object. Values with 11 or more characters are used directly as milliseconds. The 10-digit boundary covers all valid second-precision timestamps through the year 2286.
What does ISO 8601 format look like? ISO 8601 is the international standard for date and time representation. The output uses the full form YYYY-MM-DDTHH:mm:ss.sssZ, where Z denotes UTC. Example: 2025-02-28T12:00:00.000Z is noon UTC on February 28, 2025.
Can I convert dates before January 1, 1970? Yes. Enter a negative timestamp (e.g., -86400 for December 31, 1969) using the minus prefix. The datetime-local picker in most browsers also accepts years before 1970, which generates a negative Unix timestamp.
What is the relative time format based on? Relative time compares the converted date to new Date() at the moment of conversion. The difference is expressed in the largest unit that fits: seconds, minutes, hours, days, weeks, months, or years — with "ago" for past and "from now" for future.
How do I get the current Unix timestamp? Click "Use Now" to load it into the converter, or read it off the live counter card at the bottom. The counter shows both seconds (10 digits) and milliseconds (13 digits), refreshing every second. "Copy Current (seconds)" copies the seconds value directly.
Does the tool handle timezone offsets correctly? The UTC and ISO 8601 outputs are always in UTC (offset +00:00). The "Local time" row applies the browser's local timezone via toLocaleString(). The datetime-local input represents time in your local timezone, which the tool converts to UTC before computing the Unix timestamp.
Related Tools
- Coming Soon: Date Calculator — Calculate the difference between two dates in years, months, weeks, and days, or count business days between dates.
- Coming Soon: World Clock — View current times in 50+ cities to understand what UTC-based timestamps correspond to in different local times.
- Coming Soon: Timer Suite — Stopwatch and countdown timers for measuring time intervals when working with timestamp-heavy development tasks.
Try Unix Timestamp Converter now: Coming Soon: Glyph Widgets Unix Timestamp Converter