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:

LanguageCode Snippet
Pythonimport time; time.time()
JavaScriptMath.floor(Date.now() / 1000)
JavaSystem.currentTimeMillis() / 1000
PHPtime()
Gotime.Now().Unix()
RubyTime.now.to_i
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()
SwiftNSDate().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:

  1. Enter 1704067200 in the epoch field
  2. Ensure "Use milliseconds" is off (seconds)
  3. Click "Convert to Date-Time"
Result: 2024-01-01 00:00:00 (UTC) or equivalent in your timezone.

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:

  1. Enter "2024-06-15 12:00:00" in the date-time field
  2. Click "Convert to Epoch"
  3. Copy the epoch value from the results
Result: The epoch field shows the Unix timestamp (e.g. 1718452800 in UTC).

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:

  1. Click "Use Current Time"
Result: Both epoch and date-time fields are filled with the current moment.

Explanation: Quick way to get a reference timestamp or test with "now".