Last updated
The Core Formula
// Discord epoch: January 1, 2015 at 00:00:00 UTC
// = 1420070400000 milliseconds since Unix epoch
timestamp_ms = (snowflake_id >> 22) + 1420070400000
Common Pitfalls
- JavaScript: always use BigInt for Discord IDs — regular numbers lose precision
- Don't confuse Discord epoch (2015) with Twitter epoch (2010) — they're different
- The result is in milliseconds — divide by 1000 for seconds if needed
- Python's
datetime.fromtimestamp()takes seconds, not milliseconds
Use TechConverter's Discord Snowflake to Timestamp converter to instantly decode any Discord ID without writing any code.
Code Examples
JavaScript
const discordId = 175928847299117063n; const discordEpoch = 1420070400000n; const timestamp = (discordId >> 22n) + discordEpoch; console.log(Number(timestamp)); // 1462015105796
Python
discord_id = 175928847299117063 discord_epoch = 1420070400000 timestamp = (discord_id >> 22) + discord_epoch print(timestamp) # 1462015105796
Common Use Cases
- Moderation Logs: Track message timestamps for rule enforcement
- Server Analytics: Analyze user join patterns and activity trends
- Bot Commands: Display account ages and message times
- Audit Trails: Build chronological event logs from ID sequences
- Data Export: Convert Discord IDs to timestamps for external analysis
Frequently Asked Questions
Can I find when a Discord message was sent?
Yes! Every Discord message ID is a snowflake that encodes the exact millisecond the message was created. Right-click a message, copy its ID (with Developer Mode enabled), and paste it here.
How do I enable Developer Mode in Discord?
Go to User Settings → Advanced → Enable Developer Mode. This allows you to right-click messages, users, and channels to copy their IDs.
Do all Discord IDs use the same format?
Yes, Discord uses snowflake IDs for messages, users, channels, servers, roles, and more. All can be converted using this tool to find their creation date.
Why is Discord's epoch January 1, 2015?
Discord launched in May 2015, but chose January 1, 2015 as their epoch to provide a buffer for testing and development IDs created before the public launch.
Examples
Example 1: JavaScript (with BigInt for precision)
// IMPORTANT: Use BigInt to avoid precision loss with large Discord IDs
const DISCORD_EPOCH = 1420070400000n;
function snowflakeToTimestamp(id) {
const snowflake = BigInt(id);
const ms = Number((snowflake >> 22n) + DISCORD_EPOCH);
return {
ms,
seconds: Math.floor(ms / 1000),
date: new Date(ms),
iso: new Date(ms).toISOString()
};
}
console.log(snowflakeToTimestamp("817263991139819520"));
// { ms: 1613117744123, seconds: 1613117744, date: ..., iso: "2021-02-12T08:15:44.123Z" }
// ❌ Wrong — precision loss without BigInt
const wrongMs = (817263991139819520 >> 22) + 1420070400000;
// JavaScript loses precision on large integers!
Example 2: Python
from datetime import datetime, timezone
DISCORD_EPOCH_MS = 1420070400000
def snowflake_to_timestamp(snowflake_id: int) -> dict:
# Python handles large integers natively — no BigInt needed
ts_ms = (snowflake_id >> 22) + DISCORD_EPOCH_MS
dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)
return {
"ms": ts_ms,
"seconds": ts_ms // 1000,
"datetime": dt,
"iso": dt.isoformat()
}
result = snowflake_to_timestamp(817263991139819520)
print(result["iso"]) # 2021-02-12T08:15:44.123000+00:00
Example 3: Java
import java.time.Instant;
public class DiscordSnowflake {
private static final long DISCORD_EPOCH = 1420070400000L;
public static Instant snowflakeToTimestamp(long snowflakeId) {
long timestampMs = (snowflakeId >> 22) + DISCORD_EPOCH;
return Instant.ofEpochMilli(timestampMs);
}
public static void main(String[] args) {
Instant ts = snowflakeToTimestamp(817263991139819520L);
System.out.println(ts); // 2021-02-12T08:15:44.123Z
}
}