JavaScript Timestamp Converter
Convert Unix timestamps between seconds, milliseconds, and readable dates. View UTC and local time, choose time zones, convert dates to timestamps, and copy results instantly in your browser.
Timestamp to Date
Z or UTC offset is required.
Conversion Results
Out of dateTime Zone Settings
Current Timestamp
————Date and Time Formatting
Recent Conversions
Timestamp Examples
All Developer Tools
Browse free online tools for JSON, HTML, CSS, XML, JavaScript, data conversion, and everyday development tasks.
Try a different search term or select another category.
JavaScript Timestamp Converter
Convert Unix timestamps into readable dates and convert dates back into timestamps with this free JavaScript timestamp converter. Understand Unix seconds, JavaScript milliseconds, ISO 8601 dates, UTC, and local time without performing manual calculations.
Whether you're debugging an API response, inspecting JWT expiration claims, analyzing server logs, or working with JavaScript Date objects, understanding timestamps helps you identify exactly when an event occurred.
Date.now() returns milliseconds. Check the unit before converting a value to avoid dates far in the past or future.
What Is a Unix Timestamp?
A Unix timestamp, also called epoch time, represents the number of seconds elapsed since January 1, 1970, at 00:00:00 UTC. This starting point is known as the Unix epoch.
Unlike a formatted date such as October 9, 2025, a Unix timestamp stores a numeric value representing a specific moment in time. Applications can convert that value into a readable date for different time zones.
1760000000ISO 8601 result: 2025-10-09T08:53:20.000Z
The trailing Z indicates that the displayed date and time use UTC.
Timestamp to Date Conversion
Converting a timestamp into a readable date makes numeric values from APIs, databases, and logs easier to understand. In JavaScript, the Date constructor expects milliseconds, so Unix timestamps expressed in seconds must be multiplied by 1,000 first.
How to convert a timestamp
Find the numeric value in your API response, log entry, database record, or application output.
Determine whether the value represents seconds or milliseconds since the Unix epoch.
Use the appropriate JavaScript conversion and inspect the resulting date in UTC or your local time zone.
const timestampInSeconds = 1760000000;
const date = new Date(timestampInSeconds * 1000);
console.log(date.toISOString());
// 2025-10-09T08:53:20.000ZFor a timestamp already expressed in milliseconds, pass it directly to new Date() without multiplying it by 1,000.
Date to Timestamp Conversion
You can also convert a date and time into Unix seconds or JavaScript milliseconds. This is useful when preparing API payloads, storing dates in databases, comparing event times, or testing scheduled tasks.
Input date: January 1, 2026, at 00:00:00 UTC
| Output format | Result |
|---|---|
| Unix seconds | 1767225600 |
| Unix milliseconds | 1767225600000 |
| ISO 8601 UTC | 2026-01-01T00:00:00.000Z |
Convert a JavaScript Date into seconds
const date = new Date("2026-01-01T00:00:00.000Z");
const seconds = Math.floor(date.getTime() / 1000);
const milliseconds = date.getTime();
console.log(seconds); // 1767225600
console.log(milliseconds); // 1767225600000Unix Seconds vs. JavaScript Milliseconds
Seconds and milliseconds represent elapsed time using different units. Confusing the two is a common cause of incorrect dates in JavaScript applications.
| Comparison | Unix seconds | Milliseconds |
|---|---|---|
| Unit | Seconds | Milliseconds |
| Typical current value | About 10 digits | About 13 digits |
| Example | 1760000000 | 1760000000000 |
| JavaScript conversion | new Date(ts * 1000) | new Date(ts) |
| Common source | Unix tools and some APIs | Date.now() |
For a straightforward conversion, multiply seconds by 1,000 to obtain milliseconds. Divide milliseconds by 1,000 to obtain seconds. Use Math.floor() when you need a whole-second timestamp.
JavaScript Timestamp Conversion Examples
JavaScript provides built-in methods for creating timestamps, converting them to dates, and producing standardized date strings. These examples cover common developer tasks.
1. Get the current timestamp in milliseconds
const milliseconds = Date.now();
console.log(milliseconds);Date.now() returns the number of milliseconds elapsed since the Unix epoch.
2. Get the current Unix timestamp in seconds
const seconds = Math.floor(Date.now() / 1000);
console.log(seconds);This format is useful when an API or backend system expects Unix seconds instead of JavaScript milliseconds.
3. Convert seconds to a readable date
const timestamp = 1760000000;
const date = new Date(timestamp * 1000);
console.log(date.toISOString());4. Convert milliseconds to a readable date
const timestamp = 1760000000000;
const date = new Date(timestamp);
console.log(date.toISOString());5. Convert a date to ISO 8601
const now = new Date();
console.log(now.toISOString());The toISOString() method returns a standardized date-time string in UTC, typically formatted like 2026-10-15T05:06:10.000Z.
Time Zones and ISO 8601
A Unix timestamp represents one instant in time. Its displayed calendar date and clock time can change depending on the time zone used to format it. For example, the same instant can fall on different calendar dates in UTC and another region.
Coordinated Universal Time
UTC provides a consistent reference for APIs, server logs, database values, and timestamps shared between systems.
Your system's time zone
Local formatting displays the same instant using the time zone configured in the environment, which may differ from UTC.
What does ISO 8601 mean?
ISO 8601 is a standard for representing dates and times in a consistent, machine-readable format. A common UTC representation is:
2026-10-15T05:06:10.000Z2026-10-15represents the calendar date.Tseparates the date and time.05:06:10.000represents the time, including milliseconds.Zindicates that the time is expressed in UTC.
ISO 8601 strings are especially useful when exchanging date values through JSON APIs, application logs, and backend services.
Common Uses for a JavaScript Timestamp Converter
API debugging
Convert fields such as created_at, updated_at, and expires_at into readable dates when inspecting API responses.
JWT expiration checks
Interpret numeric claims such as exp, iat, and nbf. These claims commonly use Unix seconds.
Server and application logs
Translate numeric timestamps to readable dates to investigate errors, requests, events, and security activity.
Database development
Understand stored epoch values and convert dates into numeric values for testing queries and application logic.
Scheduled jobs
Check expiration dates, reminders, cron schedules, and time-dependent application behavior.
Frontend development
Convert timestamps returned by APIs into dates suitable for displaying in a user's interface.
Privacy When Converting Timestamps
Timestamps can reveal event timing, account activity, or details about internal systems. When working with sensitive logs or API data, consider whether the tool processes values locally or sends them to a remote server.
For private or production data, verify the tool's actual processing behavior and privacy policy before using it. Browser-based processing can help reduce unnecessary data transfers when implemented correctly.
JavaScript Timestamp Converter FAQ
What is a JavaScript timestamp converter?
It is a tool for converting Unix epoch timestamps into readable dates and converting dates back into timestamp values. It is particularly useful for working with JavaScript dates, APIs, logs, and databases.
What is the difference between Unix seconds and milliseconds?
Unix seconds count elapsed seconds since January 1, 1970, at 00:00:00 UTC. Milliseconds count elapsed milliseconds from the same starting point. Millisecond values are 1,000 times larger than equivalent second values.
How can I tell whether a timestamp uses seconds or milliseconds?
Modern Unix timestamps in seconds are commonly 10 digits long, while JavaScript millisecond timestamps are commonly 13 digits long. Treat this as a guideline rather than a guarantee, and confirm the expected unit whenever possible.
What does Date.now() return in JavaScript?
Date.now() returns the current time as milliseconds elapsed since the Unix epoch. To get a whole-second timestamp, use Math.floor(Date.now() / 1000).
How do I convert milliseconds to seconds in JavaScript?
Divide the millisecond value by 1,000. Use Math.floor(timestamp / 1000) if you need a whole number of seconds.
const seconds = Math.floor(Date.now() / 1000);What is ISO 8601 format?
ISO 8601 is a standard date-time representation. A common JavaScript output is 2026-10-15T05:06:10.000Z, where the trailing Z indicates UTC.
Does a Unix timestamp contain a time zone?
No. A Unix timestamp identifies an instant in time rather than a local time zone. You can display that instant in UTC or format it using a specified time zone.
Why does my converted date show the wrong year?
A common cause is confusing seconds with milliseconds. Passing a seconds-based timestamp directly to JavaScript's Date constructor makes it interpret the value as milliseconds. Multiply Unix seconds by 1,000 before creating the date.
How do I convert a Unix timestamp to ISO 8601 in JavaScript?
For a timestamp in seconds, multiply it by 1,000 and call toISOString() on the resulting date.
const timestamp = 1760000000;
const isoDate = new Date(timestamp * 1000).toISOString();
console.log(isoDate);Explore More Developer Tools
Continue working with common developer formats and utilities. Add links to these related Jomatter tools as their pages become available.
JSON Formatter
Format and organize JSON data to make API responses and configuration files easier to read.
JSON Diff Checker
Compare two JSON documents to identify differences between data structures.
UUID Generator
Generate unique identifiers for testing, development, and application workflows.
URL Encoder and Decoder
Encode or decode URL components when debugging links and query parameters.
Base64 Encoder and Decoder
Convert text between plain text and Base64 representations for development tasks.
Cron Expression Generator
Build and inspect schedules for recurring jobs and automated tasks.
Convert Timestamps with Confidence
Understand Unix seconds, JavaScript milliseconds, and ISO 8601 date strings to make debugging APIs, inspecting logs, and working with dates easier. Always confirm the timestamp unit and intended time zone before relying on a converted result.
JavaScript Timestamp Converter · Unix epoch conversion · Date and time development reference