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

Decoding the Timestamp

// JavaScript (BigInt required)
const id = 1900000000000000000n;
const twitterEpoch = 1288834974657n;

const timestampMs = (id >> 22n) + twitterEpoch;
const date = new Date(Number(timestampMs));

console.log("Date (UTC):", date.toUTCString());
console.log("ISO 8601:", date.toISOString());
console.log("Unix (ms):", timestampMs.toString());
# Python
id_val = 1900000000000000000
twitter_epoch_ms = 1288834974657

timestamp_ms = (id_val >> 22) + twitter_epoch_ms
timestamp_s = timestamp_ms / 1000

from datetime import datetime, timezone
dt = datetime.fromtimestamp(timestamp_s, tz=timezone.utc)
print(f"Date: {dt.strftime('%Y-%m-%d %H:%M:%S UTC')}")
print(f"ISO 8601: {dt.isoformat()}")

Snowflake Component Breakdown

// Extract all components
const id = 1900000000000000000n;
const twitterEpoch = 1288834974657n;

const timestamp  = (id >> 22n) + twitterEpoch;
const datacenter = (id >> 17n) & 0x1Fn;
const worker     = (id >> 12n) & 0x1Fn;
const sequence   = id & 0xFFFn;

console.log({
  date: new Date(Number(timestamp)).toISOString(),
  datacenter: Number(datacenter),
  worker: Number(worker),
  sequence: Number(sequence)
});

Using This ID for API Queries

Use ID 1900000000000000000 as a boundary for Twitter API v2 queries:

# Fetch tweets in the range around this milestone
import requests

headers = {"Authorization": "Bearer YOUR_BEARER_TOKEN"}

# Tweets after 1900000000000000000
params = {
    "query": "your search terms",
    "since_id": "1900000000000000000",
    "max_results": 100,
    "tweet.fields": "created_at,author_id"
}

response = requests.get(
    "https://api.twitter.com/2/tweets/search/recent",
    headers=headers,
    params=params
)
print(response.json())
# Tweets before 1900000000000000000 (use max_id in v1.1)
params_v1 = {
    "q": "your search terms",
    "max_id": 1900000000000000000 - 1,
    "count": 100,
    "tweet_mode": "extended"
}

response = requests.get(
    "https://api.twitter.com/1.1/search/tweets.json",
    headers=headers,
    params=params_v1
)

ID Rate Analysis

Comparing the timestamps of consecutive round-number IDs reveals Twitter's activity rate:

// Calculate days between ID milestones
function daysBetweenIds(id1Str, id2Str) {
  const twitterEpoch = 1288834974657n;
  const id1 = BigInt(id1Str);
  const id2 = BigInt(id2Str);
  
  const ts1 = Number((id1 >> 22n) + twitterEpoch);
  const ts2 = Number((id2 >> 22n) + twitterEpoch);
  
  const diffMs = Math.abs(ts2 - ts1);
  return (diffMs / (1000 * 60 * 60 * 24)).toFixed(1);
}

console.log(
  "Days between 1800000000000000000 and 1900000000000000000:",
  daysBetweenIds("1800000000000000000", "1900000000000000000")
);

Historical Context

The time period corresponding to ID 1900000000000000000 reflects a specific phase in Twitter's evolution. Researchers studying platform growth, content moderation changes, or user behavior patterns can use this milestone to anchor their analysis to a specific time window.

Building a Snowflake Decoder Utility

// Reusable Snowflake decoder utility
class TwitterSnowflake {
  static TWITTER_EPOCH = 1288834974657n;
  
  static decode(idStr) {
    const id = BigInt(idStr);
    const timestampMs = (id >> 22n) + this.TWITTER_EPOCH;
    
    return {
      id: idStr,
      timestampMs: timestampMs.toString(),
      date: new Date(Number(timestampMs)).toISOString(),
      datacenterId: Number((id >> 17n) & 0x1Fn),
      workerId: Number((id >> 12n) & 0x1Fn),
      sequence: Number(id & 0xFFFn)
    };
  }
  
  static encodeFromDate(date) {
    const timestampMs = BigInt(date.getTime()) - this.TWITTER_EPOCH;
    return (timestampMs << 22n).toString();
  }
}

// Usage
console.log(TwitterSnowflake.decode("1900000000000000000"));

// Get the minimum ID for a given date
const targetDate = new Date("2023-01-01T00:00:00Z");
console.log("Min ID for 2023-01-01:", TwitterSnowflake.encodeFromDate(targetDate));

Verifying the Decode

To verify the decoded timestamp for ID 1900000000000000000:

Round-number IDs like 1900000000000000000 are practical tools for anyone working with Twitter data. They provide reliable temporal anchors for API queries, dataset partitioning, and historical analysis without requiring additional API calls to determine the correct ID range for a target date.

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.

Twitter ID 1900000000000000000 — Decoded Example

This page decodes the Twitter Snowflake ID 1900000000000000000 and provides the corresponding timestamp. This round-number milestone is useful for developers building Twitter data tools and researchers analyzing Twitter's timeline.

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.