What this tool is good for
This timestamp converter can switch between Unix timestamps in seconds, timestamps in milliseconds, ISO 8601, ISO 9075, local date strings, and UTC output. It uses the input length and date format to help identify the value automatically, which is useful for API debugging, log analysis, database checks, and cross-language development.
The string format labels on this page follow common ISO 8601 and ISO 9075 naming, while the rendered local-time output still depends on the viewer's runtime timezone.
How to tell seconds from milliseconds
| Common length | Unit | Example | Debugging note |
|---|---|---|---|
| 10 digits | Seconds | 1704067200 | Common Unix timestamp. Multiply by 1000 before passing it to JavaScript Date. |
| 13 digits | Milliseconds | 1704067200000 | Common Date.now() output. Treating it as seconds creates a far-future date. |
| 16 digits | Microseconds | 1704067200000000 | Seen in some databases and tracing systems. Divide by 1000 to get milliseconds. |
| 19 digits | Nanoseconds | 1704067200000000000 | Common in some runtime or telemetry APIs. Scale it before using browser date APIs. |
If a converted value lands near 1970 or far in the future, the first thing to check is whether seconds and milliseconds were mixed.
For 16-digit microsecond or 19-digit nanosecond values, scale the value to seconds or milliseconds before pasting it into the converter.
UTC, local time, and ISO format reference
| Format | Example | Best use |
|---|---|---|
| Unix seconds | 1704067200 | Backend APIs, command-line tools, and numeric database fields. |
| Unix milliseconds | 1704067200000 | Browser JavaScript, frontend events, and Date.now(). |
| ISO 8601 UTC | 2024-01-01T00:00:00.000Z | Cross-timezone transport and log comparison. Z means UTC. |
| Local time | 2024-01-01 08:00:00 | User-facing display. The result depends on the current timezone. |
- For API transport, prefer Unix timestamps or ISO 8601 strings with an explicit timezone.
- For log debugging, normalize values to UTC before comparing frontend, server, and local display.
- For database fields without timezone metadata, confirm the business timezone before interpreting the value.
Typical use cases
- Verify whether a backend returns seconds or milliseconds.
- Turn a timestamp from logs into a readable date and time.
- Check for timezone offsets between backend and frontend systems.
- Copy ISO 8601, UTC, or local time strings into test scripts and database statements.
How to use it
- Enter a timestamp or a date string and the tool detects the format automatically.
- Review the results in seconds, milliseconds, ISO, UTC, and local formats.
- Copy the exact output required by the next system.
Example
Input: 2024-01-01T00:00:00Z
Timestamp (seconds): 1704067200
Timestamp (milliseconds): 1704067200000
This kind of side-by-side comparison is especially useful when debugging APIs that accidentally mix seconds and milliseconds.
Code examples
These examples use explicit UTC input so the numeric results stay stable across timezones:
// JavaScript
Math.floor(Date.parse("2024-01-01T00:00:00Z") / 1000); // 1704067200
new Date(1704067200 * 1000).toISOString(); // 2024-01-01T00:00:00.000Z
Date.now(); // current millisecond timestamp
# Python
from datetime import datetime, timezone
datetime.fromisoformat("2024-01-01T00:00:00+00:00").timestamp() # 1704067200.0
datetime.fromtimestamp(1704067200, tz=timezone.utc).isoformat() # 2024-01-01T00:00:00+00:00
int(datetime.now(timezone.utc).timestamp() * 1000) # current millisecond timestamp
<?php
strtotime("2024-01-01T00:00:00Z"); // 1704067200
gmdate("c", 1704067200); // 2024-01-01T00:00:00+00:00
FAQ
What is the difference between 10-digit and 13-digit timestamps?
A 10-digit value usually means a Unix timestamp in seconds, while a 13-digit value usually means milliseconds. Many integration bugs come from interpreting milliseconds as seconds or the other way around.
Why does the same time look different in different systems?
Timezone differences are the most common reason. A UTC time can appear differently in a local environment, so verify whether both systems are using UTC or local time before troubleshooting further.
Does a Unix timestamp include a timezone?
No. A Unix timestamp counts elapsed time from 1970-01-01 00:00:00 UTC. Timezones only affect how that instant is displayed as a calendar date.
Why can a normal date string become invalid?
Ambiguous date formats, typos, or missing separators often cause parsing failures. Standard formats such as ISO 8601 are usually the most reliable choice.
Why does an empty input show the current time immediately?
That default makes it faster to inspect the current moment across multiple output formats when you just need a quick timestamp or standard time string.
Why does 1704067200 show up as a 1970 date in JavaScript?
The JavaScript Date constructor expects milliseconds. A 10-digit Unix timestamp is in seconds, so multiply it by 1000 before creating a Date object.
Related tools
- JSON Formatter:Format, edit, and validate JSON online
- URL Encode/Decode:Encode and decode special characters in URLs