Convert Discord Snowflake ID to Date

Enter Discord message, user, or channel ID to extract creation date

Creation Date
Unix Timestamp (milliseconds)
Unix Timestamp (seconds)
ISO 8601 Format

Last updated

Discord Message IDs

Every Discord message has a unique Snowflake ID that encodes the exact millisecond it was sent. This is useful for archiving conversations, finding messages from a specific time period, and using Discord's API to fetch messages around a specific timestamp. The Discord API accepts Snowflake IDs in the before, after, and around parameters of the message fetch endpoint.

Finding Messages by Date

JavaScript
const DISCORD_EPOCH = 1420070400000n;

// Convert a date to a Discord Snowflake ID
// Useful for fetching messages before/after a specific time
function dateToSnowflake(date) {
  const ms = BigInt(date.getTime()) - DISCORD_EPOCH;
  return String(ms << 22n);
}

// Decode a message ID to get its timestamp
function decodeMessageId(messageId) {
  const id = BigInt(messageId);
  const ms = Number((id >> 22n) + DISCORD_EPOCH);
  return {
    messageId,
    createdAt: new Date(ms).toISOString(),
    timestamp: ms
  };
}

// Fetch messages from a specific date using Discord API
async function fetchMessagesFromDate(channelId, date, token) {
  const snowflake = dateToSnowflake(date);
  const response = await fetch(
    `https://discord.com/api/v10/channels/${channelId}/messages?after=${snowflake}&limit=100`,
    { headers: { Authorization: `Bot ${token}` } }
  );
  return response.json();
}

Message ID Use Cases

Frequently Asked Questions

Enter the Discord snowflake ID and click Convert. The tool extracts the embedded timestamp using the formula: (id >> 22) + 1420070400000, returning the creation date.