Last updated
Common Millisecond Timestamp Sources
- JavaScript:
Date.now(),new Date().getTime(),performance.now() - Java:
System.currentTimeMillis(),Instant.toEpochMilli() - Twitter/X API: tweet timestamps in some endpoint responses
- Discord API: Snowflake ID timestamps (milliseconds since Discord epoch)
- MongoDB: internal date storage format
- Redis:
TIMEcommand returns seconds and microseconds - Payment APIs: transaction timestamps for sub-second precision
All conversion happens entirely in your browser. No timestamp data is sent to any server.
Examples
Example 1: Converting a JavaScript Timestamp
JavaScript's Date.now() returns the current time in milliseconds. Convert a JavaScript timestamp to a readable date:
Input: 1710000000000
Output:
ISO 8601 (with ms): 2024-03-09T20:00:00.000Z
ISO 8601: 2024-03-09T20:00:00Z
UTC: Saturday, March 9, 2024 at 8:00:00 PM UTC
Unix (seconds): 1710000000
Relative: about 1 year ago
Notice that the millisecond timestamp (13 digits) is exactly 1,000 times the equivalent second-precision Unix timestamp (10 digits). This 1000x difference is the most common source of timestamp bugs when mixing data from different systems.
Example 2: Identifying Seconds vs Milliseconds
A developer sees a timestamp in a database and is not sure if it is in seconds or milliseconds:
Timestamp: 1710000000 (10 digits → seconds)
Converts to: 2024-03-09 20:00:00 UTC ✅ (reasonable date)
Timestamp: 1710000000000 (13 digits → milliseconds)
Converts to: 2024-03-09 20:00:00 UTC ✅ (same date, correct)
Timestamp: 1710000000 treated as milliseconds:
Converts to: 1970-01-20 18:40:00 UTC ❌ (wrong — 1970 is a red flag)
The converter automatically detects the format based on magnitude. A 10-digit number is treated as seconds; a 13-digit number is treated as milliseconds. If a conversion produces a date in 1970, that is a strong signal the timestamp is in seconds but was treated as milliseconds.
Example 3: Converting Twitter/X API Timestamps
Twitter's API returns tweet creation times as millisecond timestamps in the created_at field of some endpoints:
Input: 1709900000000
Output:
ISO 8601: 2024-03-08T15:13:20.000Z
UTC: Friday, March 8, 2024 at 3:13:20 PM UTC
Local (ET): Friday, March 8, 2024 at 10:13:20 AM EST
When building Twitter integrations, millisecond timestamps appear frequently in API responses. The converter helps verify that your timestamp parsing code is producing the correct dates.