Skip to content
Utilities2026-05-13Begin6 min read

Timestamp Converter: Unix Epoch Time to Date Conversion Guide

What Is a Unix Timestamp

A Unix Timestamp (Epoch Time) is the number of seconds elapsed since January 1, 1970, 00:00:00 UTC — paste any such value into an online timestamp converter to see the corresponding date instantly. It's a pure integer — for example:

  • 1700000000 → November 14, 2023 22:13:20 UTC
  • 1700000000000 → Same moment, but in milliseconds

Timestamps are the most common time representation in programming because they are timezone-agnostic, easy to store, compare, and calculate with; for recurring schedules rather than one-off moments, a cron parser is the complementary tool.

Why You Need Timestamp Conversion

  1. API debugging: Backend responses return timestamps that need human-readable conversion
  2. Log analysis: System logs use timestamps that must be converted to local time
  3. Database queries: SQL timestamp fields require conversion to dates
  4. Cross-timezone collaboration: Timestamps provide a universal time baseline

How to Use an Online Timestamp Converter

Using ToolVault's Timestamp Converter:

  1. Timestamp → Date: Paste a timestamp number; the tool auto-detects seconds/milliseconds/microseconds
  2. Date → Timestamp: Select or enter a date-time, generate a timestamp instantly
  3. Auto-detection: Paste any timestamp and the tool automatically determines the unit (s/ms/μs)

Timestamp Units Explained

UnitDigitsExampleCommon Usage
Seconds (s)101700000000Unix/Linux, SQL, Redis
Milliseconds (ms)131700000000000JavaScript, Java, Go
Microseconds (μs)161700000000000000MySQL, high-precision timing

Quick Identification

Count the digits to determine the unit, or let a timestamp converter auto-detect it for you:

  • 10 digits → seconds (e.g., 1700000000)
  • 13 digits → milliseconds (e.g., 1700000000000)
  • 16 digits → microseconds (e.g., 1700000000000000)

Timestamps in Programming Languages

JavaScript / TypeScript

// Current timestamp (milliseconds)
const ms = Date.now();  // 1700000000000

// Current timestamp (seconds)
const s = Math.floor(Date.now() / 1000);  // 1700000000

// Milliseconds → Date object
const date = new Date(1700000000000);

// Date → milliseconds
const timestamp = date.getTime();

Python

import time
from datetime import datetime

# Current timestamp (seconds)
timestamp = int(time.time())

# Timestamp → datetime
dt = datetime.fromtimestamp(1700000000)

# datetime → timestamp
timestamp = int(dt.timestamp())

Go

import "time"

// Current timestamp (seconds)
timestamp := time.Now().Unix()

// Timestamp → Time
t := time.Unix(1700000000, 0)

Common Timestamp Pitfalls

Milliseconds vs. Seconds Confusion

The most common mistake. JavaScript's Date.now() returns milliseconds, while Unix standard is seconds. Passing a 13-digit millisecond timestamp to new Date() as seconds results in a date far in the future.

Timezone Issues

Timestamps are inherently UTC, but new Date().toLocaleString() uses the local timezone. For cross-timezone work, always anchor to UTC.

The Year 2038 Problem

A 32-bit signed integer maxes out at 2147483647, corresponding to January 19, 2038. At that point, 32-bit Unix timestamps will overflow. Modern systems have migrated to 64-bit timestamps, but embedded systems and legacy databases still need attention.

The epoch families you will actually meet

They all count from an epoch, but never assume they share Unix's:

FamilyEpochUnitA Unix-seconds value looks like
Unix / JS Date.now() (careful — ms!)1970-01-01seconds / millisecondsdivide by 1000 when mixing
Java Instant1970-01-01millisecondsalways 1000× Unix seconds
.NET DateTime.Ticks0001-01-01100-nanosecond units~6.4×10^17 — instantly recognizable by magnitude
Excel serial dates1899-12-30 (leap-year quirk)days45000-ish is 2023
timeIntervalSinceReferenceDate (Apple)2001-01-01secondsadd 978,307,200 to convert

The magnitude heuristic saves more debugging than any converter: 10 digits ≈ Unix seconds, 13 ≈ milliseconds, 17+ ≈ .NET ticks, 5 digits near 45000 ≈ Excel.

Nanoseconds and snowflake IDs

A 19-digit timestamp (e.g. 1700000000000000000) is usually nanosecond-level — MySQL TIMESTAMP(6) and some logging systems use it. But some systems use 19 digits as a snowflake ID (timestamp + machine bits + sequence). The former is time; the latter is a distributed ID with a completely different decoding scheme. When you see 19 digits, check magnitude: ~1e18 is nanoseconds, much larger is a snowflake.

Implementer's note

The timestamp tool applies a unit heuristic: rough split by digit count (10 = seconds, 13 = milliseconds, 16 = microseconds, 19 = nanoseconds), then magnitude validation (a 19-digit value divided by 1e9 must land in a plausible date range to be treated as nanoseconds). Both directions show UTC and local timezone side by side to avoid "off by 8 hours" confusion.

FAQ

Are Timestamps Timezone-Agnostic?

Yes. A Unix timestamp is the number of UTC seconds — it represents the same moment regardless of timezone. Timezone only matters when converting to a human-readable date string.

What Unit Does JavaScript's Date.now() Return?

Milliseconds (ms). This is the most common beginner mistake — treating a 13-digit millisecond timestamp as a 10-digit second-level timestamp.

How Do I Get the Current Timestamp?

In a browser console, type Date.now() (milliseconds) or Math.floor(Date.now()/1000) (seconds). You can also use ToolVault's online tool for one-click access.

The three timezones of every timestamp question

Every timestamp confusion involves exactly three zones: UTC (what the database and Unix timestamps store — a timestamp IS a UTC moment, zone-free by definition), server-local (what logs print unless configured — the 2am bug where log timestamps disagree with the database by hours), and user-local (what the human expects to see). The discipline: store UTC (or epoch — same thing, different notation), render user-local, and never store "local time without zone" (the anti-pattern that makes every future reader guess which zone the string meant — ambiguous for one hour every DST transition and forever after migration). The converter displays a moment in multiple zones simultaneously — because the question "what time was this" always has three right answers and the bug is usually expecting only one.

JavaScript Date: the three hidden traps

Parsing pitfall: new Date("2026-10-03") parses as UTC midnight, but new Date("2026-10-03T10:00") parses as local time (the ISO form without timezone suffix is local per spec, date-only is UTC — the inconsistency is the trap); timezone arithmetic via getTimezoneOffset (returns minutes, sign inverted from expectation — UTC+8 returns -480); and DST-boundary arithmetic (adding 24 hours across a spring-forward gives the same clock time the next day; adding one calendar day via date arithmetic gives 23 hours — "add a day" must name which). The modern escape: Temporal API (nearly through standardization — explicit zones, no parsing ambiguity) or date-fns/luxon for the discipline today.

Databases: timestamp with time zone vs without

PostgreSQL's pair confuses everyone: timestamptz does NOT store a zone — it normalizes input to UTC and renders in the session's timezone (the name should have been "timestamp normalized to UTC"); timestamp (without) stores the literal clock reading with no zone meaning. The rule that prevents incidents: timestamptz for everything representing a moment (events, created_at — 99% of columns), timestamp-without only for future local schedules ("meeting at 9am regardless of zone changes" — the civil-time concept). MySQL's TIMESTAMP (UTC internally, session-rendered) vs DATETIME (literal, like Postgres timestamp) maps to the same decision. The migration bug to fear: converting between them silently — a DATETIME holding UTC readings reinterpreted as local shifts every row by hours, invisibly.

Field notes from building the tool

Building the timestamp tool, we insisted on showing UTC and local side by side — because debugging "off by 8 hours" needs a side-by-side comparison, not one-sided output. The Date constructor's divergent parsing of ISO vs slash dates (covered above) is also a conclusion we tested in the browser before writing it into the tool's comments.


This field note comes from ToolVault. More developer tools at the homepage.