Timestamp Converter
Convert between Unix timestamps and human-readable dates
What is Timestamp?
A Unix timestamp, also called epoch time or POSIX time, is the number of seconds that have elapsed since the Unix epoch — midnight on January 1, 1970, in Coordinated Universal Time (UTC). This deceptively simple concept underpins virtually all time handling in modern computing. Every web server, database, log file, API, and programming language uses epoch-based timestamps internally, even when they present dates in human-readable formats on the surface.
The elegance of Unix timestamps lies in their universality and simplicity. A timestamp is just a single number — 1700000000 means the exact same instant regardless of whether you are in New York, Tokyo, or London. There is no ambiguity about timezones, daylight saving time, calendar systems, or date formatting conventions. Two systems can compare timestamps with simple integer arithmetic instead of parsing complex date strings.
The complication arises at the boundary between machine time and human time. Developers constantly need to convert between epoch numbers (which APIs and databases speak) and formatted date strings (which users and log files expect). Differences between seconds and milliseconds precision, timezone conversions, and the many output formats (ISO 8601, RFC 2822, locale-specific) make this a frequent source of bugs — especially during daylight saving time transitions.
How it works
The converter accepts input in two directions. When given a numeric timestamp, it determines whether the value represents seconds or milliseconds by examining the digit count: 10 digits (values around 1.7 billion) are seconds, while 13 digits (values around 1.7 trillion) are milliseconds. This heuristic covers all dates from 2001 through 2286, which encompasses virtually all real-world timestamps you will encounter.
Once the epoch value is normalized to milliseconds, the tool creates a JavaScript Date object and extracts formatted representations. ISO 8601 output follows the pattern YYYY-MM-DDTHH:mm:ss.sssZ for UTC, or with a timezone offset like +05:30 for local time. The locale-aware format uses the Intl.DateTimeFormat API to produce output styled according to your browser language settings — for example, "November 14, 2023, 10:13:20 AM" in English or "14 novembre 2023, 10:13:20" in French.
For the reverse conversion — date to timestamp — the tool parses a date-time input through the Date constructor and extracts the epoch value with getTime() for milliseconds or divides by 1000 for seconds. The relative time display ("3 months ago" or "in 2 days") is calculated by comparing the target timestamp to the current time and selecting the appropriate unit (seconds, minutes, hours, days, months, or years) based on the magnitude of the difference.
How to use this tool
- To convert a timestamp to a date, paste or type the numeric value into the timestamp input field. The tool auto-detects whether it is seconds or milliseconds and displays the corresponding date in multiple formats instantly.
- To get the current timestamp, click the "Now" button. It captures the exact moment you click and displays both the seconds and milliseconds epoch values.
- To convert a date to a timestamp, use the date-time picker or type a date string. The tool outputs the corresponding Unix timestamp in both seconds and milliseconds.
- Review all output formats — ISO 8601 (for APIs and data interchange), locale format (for display), UTC (for server-side reference), and relative time (for quick context like "2 days ago").
- Copy any individual value by clicking the copy icon next to it, or use the results for debugging time-related issues in your application.
Examples
Debugging an expired JWT token
A JWT payload contains "exp": 1700000000. Paste 1700000000 into the converter to see it represents November 14, 2023, 10:13:20 PM UTC. This instantly tells you the token expired months ago and explains why your API is returning 401 responses.
Converting a JavaScript Date.now() value from logs
Your application logs show a 13-digit timestamp like 1700000000000 from a Date.now() call. Paste it in to confirm it is the same instant as the 10-digit version (1700000000) — the tool auto-detects the millisecond format and shows the human-readable date alongside the seconds equivalent.
Setting a cache expiration 24 hours from now
Click "Now" to get the current timestamp (e.g., 1713000000), then mentally add 86400 (the number of seconds in 24 hours) to get 1713086400. Paste the result back in to verify it corresponds to exactly 24 hours from now in your local timezone.
Comparing timestamps from different systems
Your microservice logs show a request at 1700000000 (seconds) and your frontend logs show the same request at 1700000000123 (milliseconds). Convert both to confirm they refer to the same event, with the frontend timestamp providing an extra 123 milliseconds of precision.
About this tool
Convert Unix timestamps (seconds or milliseconds) to human-readable dates and vice versa. See results in ISO 8601, locale format, and relative time. Use the "Now" button to grab the current timestamp instantly.
Common use cases
- • Converting Unix timestamps from API responses or database records to human-readable dates
- • Generating timestamps for use in API requests, database queries, or configuration files
- • Debugging time-related bugs by comparing timestamps in different formats
- • Converting between seconds and milliseconds epoch formats used by different systems
Frequently asked questions
- What is a Unix timestamp?
- A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since January 1, 1970 00:00:00 UTC. It is a widely used standard for representing time in computing, especially in APIs, databases, and log files.
- Why do some timestamps use seconds and others use milliseconds?
- Unix traditionally uses seconds since epoch, but JavaScript and many modern APIs use milliseconds for greater precision. A 10-digit number is typically seconds (e.g., 1700000000), while a 13-digit number is milliseconds (e.g., 1700000000000). This tool auto-detects and handles both.
- What timezone are the results shown in?
- Results are shown in both UTC and your browser's local timezone. The ISO 8601 output always includes the timezone offset so there is no ambiguity.
- What happens with timestamps before 1970 or after 2038?
- Unix timestamps can be negative for dates before January 1, 1970 (e.g., -86400 is December 31, 1969). The 2038 problem affects 32-bit systems where the signed integer overflows on January 19, 2038, but this tool uses JavaScript numbers (64-bit floats) that can represent timestamps well beyond the year 275,760.
- How do I get the current Unix timestamp programmatically?
- In JavaScript, use Date.now() for milliseconds or Math.floor(Date.now() / 1000) for seconds. In Python, use import time; time.time(). In Bash, use the date +%s command. This tool provides a "Now" button that grabs the current timestamp for you without writing code.
- Why do different APIs return different timestamp formats?
- There is no universal standard. Unix systems traditionally use seconds since epoch, JavaScript uses milliseconds, Java uses milliseconds, and some APIs return ISO 8601 strings. Financial and legacy systems may use their own date integer formats. This tool auto-detects seconds vs. milliseconds based on digit count and converts to all common formats.