Unix Timestamp Converter — Epoch to Date and Back

All tools
·1 min read

Unix Timestamp Converter — Epoch to Date and Back

devopstimestampdatetime

#What this tool does

Enter a Unix timestamp (seconds or milliseconds) to get a human-readable date in UTC and local time. Enter a date to get the Unix timestamp back. The tool also displays the current Unix timestamp, updating live.

#What is a Unix timestamp?

A Unix timestamp is the number of seconds elapsed since January 1, 1970 00:00:00 UTC — the Unix epoch. It is a single integer that unambiguously represents a moment in time, with no time zone confusion.

Unix timestamps are everywhere: database created_at columns, API response fields, log file entries, JWT exp and iat claims, cookies, cron schedules, and cache headers. Any system that needs to store or transmit a point in time will likely use one.

#Seconds vs milliseconds

10 digits = seconds. The standard Unix format. Ranges from 0000000000 (1970) to 2147483647 (2038 for 32-bit systems).

13 digits = milliseconds. Used by JavaScript (Date.now()), Java (System.currentTimeMillis()), and many browser APIs. A millisecond timestamp like 1709654400000 is just the seconds value multiplied by 1000.

This tool auto-detects which format you are using based on digit count. No manual toggle needed.

#Common timestamp values

0            = January 1, 1970 00:00:00 UTC   (the epoch)
1000000000   = September 9, 2001 01:46:40 UTC (the "billennium")
1700000000   = November 14, 2023 22:13:20 UTC
2000000000   = May 18, 2033 03:33:20 UTC
2147483647   = January 19, 2038 03:14:07 UTC  (Y2K38 — max 32-bit signed integer)

#The Year 2038 problem

32-bit signed integers store values up to 2,147,483,647. That number, interpreted as a Unix timestamp, corresponds to January 19, 2038 at 03:14:07 UTC. One second later, the value overflows and wraps to a negative number — interpreted as December 13, 1901.

This is the Y2K38 problem. Any system still using a 32-bit signed integer for timestamps will break.

Modern operating systems and languages use 64-bit timestamps by default. But legacy systems, embedded devices, and database schemas often do not. Check your TIMESTAMP and INT column types — if your database uses a 4-byte integer for timestamps, switch to BIGINT before 2038.

#Getting timestamps in code

# JavaScript (milliseconds)
Date.now()
 
# Python (seconds, float)
import time; time.time()
 
# Bash (seconds)
date +%s
 
# SQL — MySQL
SELECT UNIX_TIMESTAMP()
 
# SQL — PostgreSQL
SELECT EXTRACT(EPOCH FROM NOW())

#Open source

This tool is powered by @azin-tech/mini-tools, an open-source developer toolkit. View source on GitHub.

Auto-deploy into your own cloud

Push code, AZIN handles the rest. Auto-detected builds, your cloud account, no vendor lock-in.