TToolbox
🕐

Timestamp Converter

Convert between Unix time and dates

About this tool

A Unix timestamp represents the number of seconds (or milliseconds) that have elapsed since the Unix epoch: 00:00:00 UTC on January 1, 1970. It is the gold standard for clock synchronization across databases, operating systems, and microservices. This tool converts between numeric timestamps and human-readable date-time formats across multiple timezones with zero hassle.

How to Use This Tool (Step-by-Step)

1

Enter Timestamp or Pick Date

Input a 10-digit (seconds) or 13-digit (milliseconds) integer, or use the date-time picker to choose a specific calendar date and time.

2

View Formatted Conversions

The tool automatically computes conversions for your Local Time, Beijing Time (UTC+8), UTC/GMT, and ISO 8601 strings.

3

Copy Standard Date Output

Copy formatted strings directly into SQL queries, server log filters, or application code with a single click.

Auto-detect 10-digit & 13-digit

Automatically detects whether the timestamp is in seconds (10 digits) or milliseconds (13 digits), preventing the 1000x scaling error.

Accurate Multi-timezone Alignment

Explicitly displays UTC, local timezone, and key business zones, preventing common bugs caused by daylight saving shifts or offsets.

Live Real-time Clock

Features a live ticking Unix clock showing current epoch time, ideal for generating current timestamps during on-call debugging.

Common Timestamp Gotchas & Year 2038

  • •Never mix up seconds (10 digits) and milliseconds (13 digits): Languages like Java and JavaScript use ms, while Python and PHP default to seconds.
  • •Always exchange timestamps or ISO-8601 strings with timezone offsets: Bare date strings without offsets ('2026-03-20 12:00') cause severe ambiguity across distributed microservices.
  • •The Year 2038 Problem: 32-bit signed integers will overflow on January 19, 2038. Ensure all database columns storing epoch values use 64-bit integers (BIGINT).

Code & Transformation Examples

Timestamp vs Standard ISO 8601 Comparison

10-digit Timestamp (Seconds)
1774000000
Converted Date-Time
UTC: 2026-03-20 09:46:40
CST: 2026-03-20 17:46:40 (UTC+8)
ISO: 2026-03-20T09:46:40.000Z

* While the local hours differ, the underlying Unix timestamp represents the identical absolute instant.

Code Snippets across Languages

JavaScript
// 当前秒 / 毫秒
const nowSec = Math.floor(Date.now() / 1000);
const nowMs = Date.now();

// 格式化输出
const dateStr = new Date(nowSec * 1000).toLocaleString();
Python 3
import time
from datetime import datetime

# 当前秒
now_sec = int(time.time())

# 时间戳转可读字符串
readable = datetime.fromtimestamp(now_sec).strftime('%Y-%m-%d %H:%M:%S')

* JavaScript's Date constructor expects milliseconds, so always multiply 10-digit epoch seconds by 1000.

Frequently Asked Questions

Q: Is Unix timestamp affected by Daylight Saving Time (DST) or timezones?

A: Not at all. A Unix timestamp tracks absolute elapsed time since UTC epoch. At any single moment, the epoch timestamp is identical everywhere on Earth.

Q: Why does my timestamp convert to the year 1970?

A: This happens when a 10-digit timestamp (seconds) is passed to a function expecting milliseconds (like JS `new Date(ts)`). Multiplying the seconds by 1000 resolves it.

Q: Should I store timestamps as DATETIME or BIGINT in databases?

A: BIGINT is timezone-neutral, compact, and faster to index across global services. DATETIME provides better human readability. For global applications, 64-bit epoch or TIMESTAMPTZ is preferred.

Related Tools

All processing happens locally in your browser. Your data is never uploaded to a server.
/