Epoch Converter
Convert Unix timestamps to human-readable dates and back, in UTC or any IANA timezone with DST. Batch mode, auto-detect seconds/ms/us/ns. Free for developers.
Epoch & Unix Timestamp Converter - Convert Time Instantly
A powerful Unix epoch converter that converts between Unix timestamps and human-readable dates. Support batch conversion, auto-detect format (seconds/milliseconds/microseconds), multiple timezones, and various date formats. Get current timestamp with one click.
What is Unix epoch time?
The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z).
Literally speaking, the epoch is Unix time 0 (midnight 1/1/1970), but 'epoch' is often used as a synonym for Unix time.
Example:
- Timestamp: 1697356800
- Date: October 15, 2023 00:00:00 UTC
Key facts:
- Always in UTC (no timezone)
- Seconds since 1970-01-01 00:00:00
- Can be negative for dates before 1970
- 32-bit systems: Maximum 2147483647 (2038-01-19)
- This is known as the Year 2038 problem or Y2038
Commonly used in:
- Programming languages (PHP, JavaScript, Python)
- Databases (MySQL, PostgreSQL)
- APIs and web services
- File systems (modification times)
- Logging and analytics
What's the difference between seconds, milliseconds, and microseconds?
Unix timestamps can be in different precision levels:
Seconds (10 digits):
- Standard Unix timestamp
- Example: 1697356800
- Used in: PHP time(), Unix systems, most servers
- Precision: to the second
Milliseconds (13 digits):
- JavaScript timestamp
- Example: 1697356800000
- Used in: JavaScript Date.now(), some APIs
- Precision: to the millisecond (1/1000 second)
Microseconds (16 digits):
- High-precision timestamp
- Example: 1697356800000000
- Used in: Performance monitoring, precise timing
- Precision: to the microsecond (1/1,000,000 second)
Conversion:
- Seconds to milliseconds: multiply by 1,000
- Milliseconds to microseconds: multiply by 1,000
- Microseconds to seconds: divide by 1,000,000
This tool auto-detects:
- 10 digits = seconds
- 13 digits = milliseconds
- 16 digits = microseconds
- Converts appropriately
How to use the batch converter?
The batch converter allows you to convert multiple timestamps at once:
1. Select 'Batch Converter' mode
2. Enter multiple timestamps (one per line):
1697356800
1697443200
1697529600
3. Click 'Convert'
4. View all results instantly:
- Each timestamp converted to date
- Auto-detect format for each
- ISO 8601, RFC 2822, and local time
- Copy individual results
Benefits:
- Save time converting multiple timestamps
- Compare dates side by side
- Perfect for log analysis
- Batch processing for efficiency
- Export results easily
What is relative time?
Relative time shows how long ago (or until) a timestamp occurred:
Past examples:
- 'just now' (< 10 seconds ago)
- '5 minutes ago'
- '2 hours ago'
- '3 days ago'
- '2 weeks ago'
Future examples:
- 'in 30 seconds'
- 'in 5 minutes'
- 'in 2 hours'
- 'in 3 days'
Why it's useful:
- More intuitive than exact dates
- Better user experience
- Common in social media
- Easy to understand
- Shows context at a glance
The tool shows both:
- Absolute time (exact date/time)
- Relative time (X ago / in Y)
Perfect for:
- Social media timestamps
- Activity feeds
- Comment systems
- Notification times
- Last update indicators

How accurate is the conversion?
The conversion is highly accurate:
Precision:
- Seconds: accurate to 1 second
- Milliseconds: accurate to 1 millisecond
- Microseconds: accurate to 1 microsecond
Timezone handling:
- UTC: exact universal time
- Local: adjusted for your timezone
- DST: automatically handled by browser
Limitations:
- JavaScript Date limitations apply
- Leap seconds not counted (per Unix spec)
- 32-bit overflow: Year 2038 problem
- Very old dates may have calendar issues
Client-side processing:
- No server delays
- Instant conversion
- Privacy-friendly (no data sent)
- Works offline
The tool uses:
- JavaScript Date object
- Native timezone detection
- Standard time APIs
- Tested and reliable methods
How do I convert a timestamp to a specific timezone?
A Unix timestamp itself has no timezone — it always counts seconds from 1970-01-01 00:00:00 UTC. The timezone only matters when you DISPLAY it as a wall-clock date.
With this tool:
1. Choose Timestamp to Date, Current Timestamp, or Batch mode.
2. Pick a timezone from the Timezone selector (it lists every IANA zone your browser supports, e.g. America/New_York, Europe/London, Asia/Ho_Chi_Minh).
3. Convert — the result shows the date in UTC, your browser Local time, AND the chosen zone with its correct UTC offset.
Daylight Saving Time (DST) is handled automatically: the offset is computed for that specific date, so a summer timestamp in America/New_York shows -04:00 (EDT) while a winter one shows -05:00 (EST).
Example: timestamp 1697356800
- UTC: 2023-10-15 08:00:00
- Asia/Ho_Chi_Minh: 2023-10-15 15:00:00 (+07:00)
- America/New_York: 2023-10-15 04:00:00 (-04:00, DST active)
This matches what 'Auto (Local)' shows when your machine is set to that zone, but lets you inspect any region without changing system settings — ideal for debugging logs from servers in other regions.
Code snippets: get a Unix timestamp in PHP, JS, Python, and MySQL
Common ways to produce or read a Unix timestamp across languages and databases:
PHP:
- Current seconds: time()
- Milliseconds: (int) (microtime(true) * 1000)
- Timestamp from date: strtotime('2023-10-15 00:00:00 UTC')
- Format a timestamp: date('Y-m-d H:i:s', 1697356800)
JavaScript:
- Current milliseconds: Date.now()
- Current seconds: Math.floor(Date.now() / 1000)
- From timestamp: new Date(1697356800 * 1000).toISOString()
Python:
- Current seconds (float): import time; time.time()
- Integer seconds: int(time.time())
- From timestamp (UTC): from datetime import datetime, timezone; datetime.fromtimestamp(1697356800, timezone.utc)
MySQL:
- Current seconds: SELECT UNIX_TIMESTAMP();
- Timestamp to date: SELECT FROM_UNIXTIME(1697356800);
- Date to timestamp: SELECT UNIX_TIMESTAMP('2023-10-15 00:00:00');
Shell (GNU date):
- Current seconds: date +%s
- Timestamp to date (UTC): date -u -d @1697356800
Note: PHP, Python time.time() and MySQL UNIX_TIMESTAMP() return SECONDS, while JavaScript Date.now() returns MILLISECONDS — paste either into this tool and the format is auto-detected.
Why are timestamps important in programming?
Timestamps are fundamental in programming:
Time Recording:
- User registration dates
- Last login times
- File creation/modification
- Log entries
- Event tracking
Time Calculations:
- Duration between events
- Age calculations
- Expiration checks
- Scheduling tasks
- Rate limiting
Timezone Independence:
- Store time in UTC (timestamp)
- Display in user's local timezone
- No timezone confusion
- Consistent across servers worldwide
Sorting and Indexing:
- Easy numeric comparison
- Fast database sorting
- Efficient indexing
- Simple arithmetic (add/subtract seconds)
APIs and Data Exchange:
- Standard format across languages
- JSON-friendly (just a number)
- No parsing ambiguity
- Universal understanding
Quick reference:
- 1 hour = 3,600 seconds
- 1 day = 86,400 seconds
- 1 week = 604,800 seconds
- 1 month ≈ 2,629,743 seconds
- 1 year ≈ 31,556,926 seconds
Key Features
- Convert Unix timestamp to date
- Convert date to Unix timestamp
- Batch converter - convert multiple timestamps at once
- Auto-detect format by magnitude (seconds/milliseconds/microseconds/nanoseconds)
- Relative time display (X ago / in Y)
- Quick reference table for time units
- Support seconds, milliseconds, microseconds, and nanoseconds
- Standard date formats (ISO 8601, RFC 2822)
- Any IANA timezone with correct UTC offset and DST (plus UTC and Local)
- Get current timestamp with one click
- Copy timestamps and dates to clipboard
- 100% client-side processing
- No server communication
- Works offline
- Dark mode support
- Mobile-friendly
- Fast and efficient
