Complete Guide to Timestamp Conversion: Unix Time, Time Zones, and Date Math
What Is a Unix Timestamp?
A Unix timestamp is the number of seconds (or milliseconds) since 1970-01-01 00:00:00 UTC.
1704067200 → 2024-01-01 00:00:00 UTC
1704067200000 → 2024-01-01 00:00:00 UTC (milliseconds)
| Type | Digits | Range | Typical use |
|---|---|---|---|
| Seconds | 10 | ~year 2038 | Linux, MySQL, PHP |
| Milliseconds | 13 | ~year 2286 | JavaScript, Java, APIs |
Year 2038 problem: On 32-bit systems, second-level timestamps overflow on 2038-01-19. Modern systems widely use 64-bit.
Using the ToolsKu Timestamp Converter
Steps
- Open the Timestamp Converter
- Enter a timestamp or pick a date
- Results update automatically in both directions
- Switch between seconds and milliseconds
Common conversions
| Input | Seconds | Milliseconds |
|---|---|---|
| 2024-01-01 00:00:00 UTC | 1704067200 | 1704067200000 |
| 2025-06-01 00:00:00 UTC | 1748736000 | 1748736000000 |
| Now | Date.now()/1000 |
Date.now() |
Time Zone Handling
UTC vs local time
UTC: 2024-06-01 08:00:00
Beijing: 2024-06-01 16:00:00 (UTC+8)
Tokyo: 2024-06-01 17:00:00 (UTC+9)
New York: 2024-06-01 04:00:00 (UTC-4, EDT)
Key principle: Timestamps are globally unified (UTC-based); conversion to local time happens only when displaying.
JavaScript pitfalls
// ❌ Implicit local time zone
new Date('2024-06-01').getTime(); // May parse as local midnight
// ✅ Explicit UTC
new Date('2024-06-01T00:00:00Z').getTime(); // Clearly UTC
// ✅ From timestamp (no time zone ambiguity)
new Date(1704067200000); // Consistent worldwide
Developer Workflows
API debugging
{
"created_at": 1704067200,
"updated_at": 1704153600,
"expires_at": 1706745600
}
Paste created_at into the Timestamp Converter to see human-readable times.
Log analysis
[1704067200] ERROR: Connection timeout
[1704067203] INFO: Retrying...
[1704067210] INFO: Connected
After conversion:
[2024-01-01 00:00:00] ERROR: Connection timeout
[2024-01-01 00:00:03] INFO: Retrying... (retry after 3 seconds)
[2024-01-01 00:00:10] INFO: Connected (connected after 7 seconds)
Cron expressions
0 0 * * * → Every day at 00:00
0 */6 * * * → Every 6 hours
0 9 * * 1-5 → Weekdays at 09:00
Use the Cron Explainer to turn Cron expressions into plain-language descriptions.
Related tools
- Timestamp Converter — timestamp ↔ date
- Date Calculator — add/subtract dates, intervals
- World Clock — multi-time-zone comparison
- Cron Explainer — Cron expression reference
Summary
Timestamps are the standard for exchanging time across systems and time zones. Know seconds vs milliseconds, the UTC baseline, and JavaScript date parsing traps—these come up constantly in daily development. The ToolsKu Timestamp Converter makes conversion instant.