What Is a Unix Timestamp?
A Unix timestamp is an integer representing the number of seconds elapsed since January 1, 1970 00:00:00 UTC — the Unix epoch. Examples:
1716076800 → 2024-05-19 00:00:00 UTC
0 → 1970-01-01 00:00:00 UTC (epoch start)
-86400 → 1969-12-31 00:00:00 UTC (before epoch)
Timestamps can also be in milliseconds — JavaScript's Date.now() returns milliseconds (13 digits instead of 10).
Why Do Developers Use Timestamps?
- Timezone-agnostic: Timestamps represent absolute time with no timezone ambiguity. Store as a timestamp, display in the user's local timezone
- Easy arithmetic: Time difference = timestamp difference in seconds. Adding or subtracting time is simple integer math
- Database-friendly: Integers are compact, index well, and sort trivially
- Universal: Every major programming language has built-in timestamp support
Convert Between Timestamp and Date
Use tool.tl's timestamp converter:
- Go to tool.tl/timestamp-converter
- Enter a timestamp (seconds or milliseconds) → see the date/time in multiple timezones instantly
- Or enter a date/time → get the corresponding timestamp
- The tool auto-detects second vs millisecond precision
Working with Timestamps in Code
# Python
import time
from datetime import datetime, timezone
# Current timestamp (seconds)
now_ts = int(time.time()) # e.g. 1716076800
# Timestamp to datetime
dt = datetime.fromtimestamp(1716076800, tz=timezone.utc)
print(dt) # 2024-05-19 00:00:00+00:00
# Datetime to timestamp
dt = datetime(2024, 5, 19, tzinfo=timezone.utc)
ts = int(dt.timestamp()) # 1716076800
# JavaScript
Date.now() // millisecond timestamp
new Date(1716076800000).toISOString() // 2024-05-19T00:00:00.000Z
new Date('2024-05-19T00:00:00Z').getTime() // millisecond timestamp
Common Time Intervals in Seconds
| Duration | Seconds |
| 1 minute | 60 |
| 1 hour | 3,600 |
| 1 day | 86,400 |
| 1 week | 604,800 |
| 30 days | 2,592,000 |
| 1 year (365 days) | 31,536,000 |
Frequently Asked Questions
What is the Year 2038 problem?
A 32-bit signed integer can hold a maximum timestamp of 2,147,483,647, which corresponds to January 19, 2038. Systems using 32-bit timestamps will overflow on that date. Modern systems use 64-bit integers, which can hold timestamps for billions of years — the problem is largely solved for new software.
How do I tell seconds from milliseconds?
Quick rule: 13+ digits → milliseconds (e.g., 1716076800000); 10 digits → seconds (e.g., 1716076800). The converter auto-detects the precision.
Is the converter free?
Yes — tool.tl's timestamp converter is completely free, supports multiple timezone display, no account needed.