Convert Twitter Snowflake ID to Unix Timestamp

Enter Twitter/X snowflake ID to extract Unix timestamp

Unix Timestamp (milliseconds)
Unix Timestamp (seconds)
Tweet Posted On
ISO 8601 Format

Last updated

Twitter Snowflake to Date Converter — Examples

The Twitter Snowflake to Date Converter quickly converts any Twitter ID to a human-readable date. Paste an ID or URL and get the creation date instantly. Here are examples of how it works.

Basic Conversion

// JavaScript — convert Snowflake ID to date
function snowflakeToDate(idStr) {
  const id = BigInt(idStr);
  const TWITTER_EPOCH = 1288834974657n;
  const timestampMs = (id >> 22n) + TWITTER_EPOCH;
  return new Date(Number(timestampMs));
}

// Examples
const ids = [
  "1529877576591609861",
  "1700000000000000000",
  "1800000000000000000",
];

ids.forEach(id => {
  const date = snowflakeToDate(id);
  console.log(`${id} → ${date.toDateString()}`);
});
# Python — convert Snowflake ID to date
from datetime import datetime, timezone

def snowflake_to_date(id_str):
    id_val = int(id_str)
    ts_ms = (id_val >> 22) + 1288834974657
    return datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)

# Examples
ids = ["1529877576591609861", "1700000000000000000", "1800000000000000000"]
for id_str in ids:
    dt = snowflake_to_date(id_str)
    print(f"{id_str} → {dt.strftime('%B %d, %Y')}")

Parsing IDs from Twitter URLs

// The converter automatically extracts IDs from Twitter/X URLs
function urlToDate(input) {
  let idStr = input.trim();
  
  // Extract from URL
  const match = input.match(/\/status\/(\d+)/);
  if (match) idStr = match[1];
  
  if (!/^\d+$/.test(idStr)) {
    return { error: "No valid Twitter ID found" };
  }
  
  const date = snowflakeToDate(idStr);
  return {
    id: idStr,
    date: date.toDateString(),
    time: date.toTimeString().split(" ")[0] + " UTC",
    iso8601: date.toISOString(),
    age: getAge(date)
  };
}

function getAge(date) {
  const days = Math.floor((Date.now() - date.getTime()) / 86400000);
  if (days < 1) return "Today";
  if (days < 7) return `${days} days ago`;
  if (days < 30) return `${Math.floor(days / 7)} weeks ago`;
  if (days < 365) return `${Math.floor(days / 30)} months ago`;
  return `${Math.floor(days / 365)} years ago`;
}

// Works with all these formats:
console.log(urlToDate("https://twitter.com/user/status/1529877576591609861"));
console.log(urlToDate("https://x.com/user/status/1529877576591609861"));
console.log(urlToDate("1529877576591609861"));

Local Timezone Display

// Show date in user's local timezone
function snowflakeToLocalDate(idStr, timezone) {
  const date = snowflakeToDate(idStr);
  
  const options = {
    timeZone: timezone || Intl.DateTimeFormat().resolvedOptions().timeZone,
    year: "numeric",
    month: "long",
    day: "numeric",
    hour: "2-digit",
    minute: "2-digit",
    second: "2-digit",
    timeZoneName: "short"
  };
  
  return {
    utc:   date.toISOString(),
    local: date.toLocaleString("en-US", options),
    dayOfWeek: date.toLocaleDateString("en-US", { weekday: "long" })
  };
}

const id = "1529877576591609861";
console.log(snowflakeToLocalDate(id, "America/New_York"));
console.log(snowflakeToLocalDate(id, "Europe/London"));
console.log(snowflakeToLocalDate(id, "Asia/Tokyo"));

Reverse: Date to Snowflake ID

// Convert a date to the minimum Snowflake ID for that moment
// Use as since_id in Twitter API queries

function dateToSnowflakeId(dateStr) {
  const date = new Date(dateStr);
  const TWITTER_EPOCH = 1288834974657n;
  const tsMs = BigInt(date.getTime()) - TWITTER_EPOCH;
  
  if (tsMs < 0n) {
    throw new Error("Date is before Twitter's Snowflake epoch (Nov 4, 2010)");
  }
  
  return (tsMs << 22n).toString();
}

// Find the min ID for specific dates
const dates = ["2022-01-01", "2023-01-01", "2024-01-01"];
dates.forEach(d => {
  console.log(`${d}: min ID = ${dateToSnowflakeId(d)}`);
});

Verifying Tweet Dates

# Python — verify a tweet's date from its ID
# The Snowflake timestamp cannot be falsified

import re
from datetime import datetime, timezone

def verify_tweet_date(tweet_url):
    """
    Extract and verify the creation date of a tweet from its URL.
    The decoded date is objective and cannot be manipulated.
    """
    match = re.search(r'/status/(\d+)', tweet_url)
    if not match:
        return {"error": "No tweet ID found in URL"}
    
    id_str = match.group(1)
    id_val = int(id_str)
    ts_ms = (id_val >> 22) + 1288834974657
    dt = datetime.fromtimestamp(ts_ms / 1000, tz=timezone.utc)
    
    return {
        "tweet_id": id_str,
        "created_at": dt.strftime("%B %d, %Y at %H:%M:%S UTC"),
        "iso8601": dt.isoformat(),
        "day_of_week": dt.strftime("%A"),
        "note": "Date derived from tweet ID — cannot be falsified"
    }

url = "https://twitter.com/user/status/1529877576591609861"
result = verify_tweet_date(url)
for k, v in result.items():
    print(f"{k}: {v}")

Date Formats Produced

The converter is the fastest way to get a human-readable date from a Twitter ID. Paste any ID or URL and the date appears immediately — no code required.

Code Examples

JavaScript

const tweetId = 1382350606417817604n; const twitterEpoch = 1288834974657n; const timestamp = (tweetId >> 22n) + twitterEpoch; console.log(Number(timestamp)); // 1618592259657

Python

tweet_id = 1382350606417817604 twitter_epoch = 1288834974657 timestamp = (tweet_id >> 22) + twitter_epoch print(timestamp) # 1618592259657

Common Use Cases

Frequently Asked Questions

Can I get the exact millisecond a tweet was posted?

Yes! Twitter snowflake IDs encode millisecond-precision timestamps. Our converter extracts the exact millisecond the tweet was created on Twitter's servers.

Do X (formerly Twitter) IDs use the same format?

Yes, X continues to use the same snowflake ID format with the same epoch (November 4, 2010). All tweet IDs from both Twitter and X can be converted using this tool.

Why is Twitter's epoch November 4, 2010?

Twitter launched snowflake IDs on November 4, 2010, replacing sequential IDs. This date became the epoch for all future tweet IDs.

Can I convert timestamps back to tweet IDs?

Not exactly. While you can create a snowflake ID from a timestamp, you can't recreate the original tweet ID because it also contains worker ID and sequence number.

Frequently Asked Questions

Enter the Twitter snowflake ID and click Convert. The tool extracts the embedded timestamp using the formula: (id >> 22) + 1288834974657, returning the Unix timestamp in milliseconds.

Twitter's snowflake epoch is 1288834974657 milliseconds (November 4, 2010, 01:42:54 UTC). All Twitter IDs encode timestamps relative to this epoch.