Epoch Time Calculator
Convert Unix timestamps to dates and back. Free epoch time converter with timezone support, milliseconds, and developer cheat sheet.
Seconds since January 1, 1970 UTC
Local timezone format
How to Get Current Epoch Time
Quick reference for getting the current Unix timestamp in popular programming languages:
| Language | Code Snippet |
|---|---|
| Python | import time; time.time() |
| JavaScript | Math.floor(Date.now() / 1000) |
| Java | System.currentTimeMillis() / 1000 |
| PHP | time() |
| Go | time.Now().Unix() |
| Ruby | Time.now.to_i |
| C# | DateTimeOffset.UtcNow.ToUnixTimeSeconds() |
| Swift | NSDate().timeIntervalSince1970 |
| SQL (MySQL) | SELECT UNIX_TIMESTAMP(); |
| Shell (Bash) | date +%s |
Unix time (also known as Epoch time, POSIX time, or Unix timestamp) is a system for describing a point in time—the number of seconds since the Unix Epoch (00:00:00 UTC on Thursday, 1 January 1970), not counting leap seconds. The epoch time calculator converts Unix timestamps to human-readable dates and back, the standard way computers store and exchange timestamps. Use it to decode log entries, debug APIs, verify database values, or quickly check "what time is that timestamp?" in your local timezone.
How to Use Epoch Time Calculator
Convert Epoch to Date
Enter a Unix timestamp (seconds since 1970-01-01 UTC) in the epoch field. Toggle "Use milliseconds" if your value is in milliseconds. Click "Convert to Date-Time" to see the equivalent date and time in your timezone.
Convert Date to Epoch
Enter a date and time in YYYY-MM-DD HH:mm:ss format (e.g. 2024-01-15 14:30:00) in the date-time field. Click "Convert to Epoch" to get the Unix timestamp. The result updates the epoch field so you can copy it.
Use Current Time
Click "Use Current Time" to fill both fields with the current moment. Helpful for testing, debugging, or getting a reference timestamp in your timezone.
Timezone and Milliseconds
Select your timezone from the dropdown; the tool uses your browser's timezone by default. Enable "Use milliseconds" when working with JavaScript Date.getTime(), APIs that return milliseconds, or other millisecond-precision sources.
Calculator Features
Two-Way Conversion
Convert epoch seconds or milliseconds to date-time, or date-time to epoch, with one click.
Timezone Aware
Shows and uses your detected timezone (or UTC) so conversions match your local time.
Milliseconds Support
Handle both seconds and milliseconds to match JavaScript, APIs, and various systems.
Use Current Time
Instantly fill epoch and date-time with the current moment for quick reference.
Clear Validation
Helpful error messages for invalid timestamps or date formats.
Developer Friendly
Designed for logs, APIs, and databases—simple inputs and readable outputs.
Complete Function List
- Convert Unix epoch (seconds) to date and time:
- Convert date and time to Unix epoch:
- Support for milliseconds (e.g. JavaScript timestamps):
- Timezone selection (auto-detected or UTC):
- Use current time with one click:
- YYYY-MM-DD HH: mm
- Reset to clear inputs and results:
- Clear error messages for invalid input:
- Copy-friendly epoch and date-time display:
Common Calculations & Examples
Example 1: Decode a Log Timestamp
Problem: A log shows timestamp 1704067200 and you need the exact date and time.
Steps:
- Enter 1704067200 in the epoch field
- Ensure "Use milliseconds" is off (seconds)
- Click "Convert to Date-Time"
Explanation: Useful for reading logs, debugging, or verifying when an event occurred.
Example 2: Get Epoch for a Specific Date
Problem: You need the Unix timestamp for 2024-06-15 12:00:00.
Steps:
- Enter "2024-06-15 12:00:00" in the date-time field
- Click "Convert to Epoch"
- Copy the epoch value from the results
Explanation: Handy for APIs, database queries, or scripts that expect epoch time.
Example 3: Check Current Time as Epoch
Problem: You want the current moment as both epoch and date-time.
Steps:
- Click "Use Current Time"
Explanation: Quick way to get a reference timestamp or test with "now".