Converting milliseconds to a date means changing a number count into a calendar time. This count is the time that has passed since January 1 1970 — the Unix Epoch. Use the free Unix Timestamp Converter to convert any milliseconds value to a readable date instantly — paste your number and get the result in seconds.
Milliseconds vs Seconds — The Key Difference
Before converting you need to know whether your number is in milliseconds or seconds:
10 digits = seconds — for example 1785283200
13 digits = milliseconds — for example 1785283200000
Milliseconds are 1000 times larger than seconds. To convert milliseconds to seconds divide by 1000. To convert seconds to milliseconds multiply by 1000.
This distinction matters because most Unix timestamp tools including the Unix Timestamp Converter expect seconds. If you paste a 13-digit milliseconds value into a seconds converter you will get a date thousands of years in the future.
How to Convert Milliseconds to Date Online
The fastest way to convert milliseconds to a readable date:
- Go to the Unix Timestamp Converter
- Paste your milliseconds value
- If your number is 13 digits divide by 1000 first to get seconds
- The converter shows the readable date and time instantly
How to Convert Milliseconds to Date in Code
JavaScript
// Convert milliseconds to date
const milliseconds = 1785283200000;
const date = new Date(milliseconds);
console.log(date.toISOString()); // 2026-07-29T00:00:00.000Z
console.log(date.toLocaleDateString()); // 7/29/2026
JavaScript's new Date() constructor accepts milliseconds directly — no division needed.
Python
from datetime import datetime
milliseconds = 1785283200000
# Divide by 1000 to convert to seconds first
date = datetime.fromtimestamp(milliseconds / 1000.0)
print(date) # 2026-07-29 00:00:00
# Or use UTC
date_utc = datetime.utcfromtimestamp(milliseconds / 1000.0)
print(date_utc) # 2026-07-29 00:00:00
Python's datetime.fromtimestamp() expects seconds — always divide milliseconds by 1000 first.
PHP
$milliseconds = 1785283200000;
// Divide by 1000 to get seconds
$date = date('Y-m-d H:i:s', $milliseconds / 1000);
echo $date; // 2026-07-29 00:00:00
Java
long milliseconds = 1785283200000L;
Date date = new Date(milliseconds);
System.out.println(date);
// Java's Date constructor accepts milliseconds directly
JavaScript — Date to Milliseconds (Reverse)
// Convert date to milliseconds
const date = new Date('2026-07-29');
const milliseconds = date.getTime();
console.log(milliseconds); // 1785283200000
// Or use Date.now() for current time in milliseconds
const now = Date.now();
console.log(now); // current milliseconds
Python — Date to Milliseconds (Reverse)
from datetime import datetime
import time
# Convert date to milliseconds
dt = datetime(2026, 7, 29)
milliseconds = int(dt.timestamp() * 1000)
print(milliseconds) # 1785283200000
How to Get Current Time in Milliseconds
Different programming languages return current time in milliseconds differently:
| Language | Code |
|---|---|
| JavaScript | Date.now() |
| Python | round(time.time() * 1000) |
| Java | System.currentTimeMillis() |
| PHP | (int)(microtime(true) * 1000) |
| C# | DateTimeOffset.UtcNow.ToUnixTimeMilliseconds() |
| Go | time.Now().UnixMilli() |
| Ruby | (Time.now.to_f * 1000).floor |
| Rust | SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_millis() |
| SQL Server | DATEDIFF_BIG(MILLISECOND,'1970-01-01', SYSUTCDATETIME()) |
| PostgreSQL | extract(epoch FROM now()) * 1000 |
Common Epoch Formats — Milliseconds vs Other Units
| Format | Digits | Example | Unit |
|---|---|---|---|
| Unix seconds | 10 | 1785283200 | Seconds since 1970 |
| Unix milliseconds | 13 | 1785283200000 | Milliseconds since 1970 |
| Unix microseconds | 16 | 1785283200000000 | Microseconds since 1970 |
| Unix nanoseconds | 19 | 1785283200000000000 | Nanoseconds since 1970 |
Why Discord Uses Seconds Not Milliseconds
Discord timestamps use 10-digit Unix seconds — not milliseconds. If you pass a 13-digit milliseconds value to a Discord timestamp code the date will appear thousands of years in the future.
Always divide your milliseconds value by 1000 before using it in a Discord timestamp code. Use the Unix Timestamp Converter to verify your value is 10 digits before pasting it into Discord.
See the complete Discord Timestamp Guide for all 7 Discord timestamp formats and how to generate them correctly.
Common Conversion Mistakes
Pasting milliseconds into a seconds converter — A 13-digit milliseconds value in a seconds converter returns a date thousands of years in the future. Always check your digit count first and divide by 1000 if needed.
Forgetting timezone — Unix timestamps are always UTC. When converting to a readable date make sure you account for your local timezone offset or you will get a time that is hours off.
Using Date.now() when you need seconds — JavaScript's Date.now() returns milliseconds. If you need seconds for a Unix timestamp divide by 1000: Math.floor(Date.now() / 1000).
Confusing milliseconds with microseconds — Some systems use microseconds (16 digits) or nanoseconds (19 digits). Divide microseconds by 1000000 and nanoseconds by 1000000000 to get seconds.
Related Guides
- Unix Timestamp — Complete Guide
- What Is Epoch Time?
- Unix Timestamp to Date — Conversion Guide
- Discord Timestamp — Complete Guide to All 7 Formats
Also try our free tools:
- Unix Timestamp Converter — convert milliseconds and seconds to readable dates instantly
- Discord Timestamp Generator — generate Discord timestamp codes for any date
- Discord Countdown Generator — build live countdown timers
- Discord Snowflake ID Decoder — decode any Discord ID instantly
Frequently Asked Questions
Ready to generate Discord timestamps?
Open the Generator