All tools

Unix Timestamp Converter

Convert Unix timestamps to human-readable dates, auto-detect seconds vs milliseconds, and inspect JWT time claims.

Current Unix time
Seconds1774728403
Milliseconds1774728403000
Input
Try:
Runs in your browser. We do not store your input.Unix timestamps are UTC-based.

Get the current Unix timestamp in popular languages

Copy-pasteable snippets for getting the current epoch time.

JavaScript / Node.js

Math.floor(Date.now() / 1000)

Python

import time
int(time.time())

Go

time.Now().Unix()

PHP

time()

Java

System.currentTimeMillis() / 1000L

PostgreSQL

SELECT extract(epoch FROM now());

Bash

date +%s

Ruby

Time.now.to_i

This tool runs entirely in your browser. Your input is never sent to CodeAva servers and is not stored between sessions. All conversions happen client-side using native JavaScript Date APIs.

Overview

What is a Unix timestamp?

A Unix timestamp, also called Epoch time, is the number of seconds that have elapsed since January 1, 1970, at 00:00:00 UTC, excluding leap seconds in common Unix implementations. Developers use it to represent time consistently across systems, APIs, databases, logs, and authentication workflows.

Unix time is deliberately timezone-agnostic: it always represents a specific instant in UTC. This makes it reliable for comparing events across distributed systems, storing timestamps in databases without timezone ambiguity, and setting expiry values in tokens and certificates.

The confusion typically starts when developers need to convert between Unix timestamps and human-readable dates. Seconds vs milliseconds mismatches, local-time assumptions, and inconsistent API conventions cause silent bugs that are hard to trace in logs, JWT payloads, cron schedules, and database queries.

Use cases

When to use it

  • Log debuggingconvert timestamps from server logs into readable dates to trace event sequences.
  • API payload inspectionverify that created_at, updated_at, or expires_at fields carry the correct epoch values.
  • JWT expiry validationextract and inspect iat, exp, and nbf claims to diagnose token-related auth issues.
  • Cron and scheduled job debuggingconfirm that scheduled execution times translate to the expected UTC moments.
  • Database timestamp conversiontranslate integer timestamps from PostgreSQL, MySQL, or SQLite into human-readable dates.
  • Seconds vs milliseconds clarificationauto-detect whether a value is in seconds or milliseconds and see both outputs.

When it's not enough

  • Timezone-aware schedulingthis tool converts to UTC and local browser time. For DST-aware scheduling logic, use a proper timezone library.
  • Production token verificationJWT timestamp extraction reads claims but does not verify signatures. Use your auth server for verification.
  • Sub-millisecond precisionJavaScript Date operates at millisecond resolution. For nanosecond timestamps, use language-specific libraries.

How to use it

  1. 1

    Paste a timestamp or date

    Enter a Unix timestamp (e.g. 1700000000) or a date string (e.g. 2024-11-14T22:13:20Z) into the input field.

  2. 2

    Let CodeAva detect the format

    The tool auto-detects whether your input is seconds, milliseconds, or a date string. Use the unit selector to override if needed.

  3. 3

    Review the converted outputs

    See the result in UTC, local time, ISO 8601, relative time, and both Unix second and millisecond formats.

  4. 4

    Copy the format you need

    Each output has a 1-click copy button. Grab the exact format your code, API, or database expects.

  5. 5

    Optionally inspect JWT time claims

    Switch to the JWT tab, paste a token, and see iat, exp, and nbf converted to readable dates with expiry status.

Common errors and fixes

Date appears far in the future (year 53000+)

You likely pasted a millisecond timestamp into a seconds-only field, or the tool detected it as seconds. Switch the unit selector to Milliseconds.

Date appears as 1970-01-01 or close to it

A very small number was interpreted as a Unix timestamp near epoch zero. Confirm the value is actually a timestamp and not an ID or index.

Local time does not match expected timezone

Unix timestamps are always UTC. The local time output uses your browser's timezone. If your system clock or timezone is misconfigured, the local output will be wrong.

JWT shows 'No time claims found'

The token's payload does not contain iat, exp, or nbf fields. Not all JWTs include time claims. Check the full token structure with the JWT Decoder.

Off-by-1000x difference between expected and actual date

This is the most common timestamp mistake: confusing seconds and milliseconds. A 10-digit number is seconds; a 13-digit number is milliseconds. Use the unit selector to force the correct interpretation.

Frequently asked questions