WorldClockTools.
世界時鐘轉換器會議規劃器CountdownsTrackingMarketsTools

WorldClockTools.

Time, simplified

工具

  • 世界時鐘
  • 時區轉換器
  • Timezone Reference
  • Watchlist
  • 會議規劃器
  • 計時器
  • 碼錶
  • Date Calculators
  • Exact Time
  • Countdowns
  • Market Hours
  • Browse pages
  • Clock Widgets
  • Find meeting time
  • Recurring drift
  • Time until…
  • DST calendar
  • Cron translator
  • Status-page widget
  • Embed gallery
  • Eclipse calendar
  • DST pair drift
  • Travel brief
  • Public Holidays
  • Airports

Regions

  • Americas
  • Europe
  • Asia
  • Africa
  • Oceania

Popular Cities

  • New York
  • São Paulo
  • Mexico City
  • London
  • Paris
  • Berlin
  • Tokyo
  • Shanghai
  • Mumbai
  • Lagos

轉換器

  • EST to PST
  • PST to IST
  • GMT to EST
  • CET to EST
  • IST to GMT

Hubs

  • City Compare
  • Business overlap
  • Market Hours
  • Open now
  • Countdowns
  • Tracking
  • US disclosures
  • EU disclosures
  • India disclosures
  • Browse hub
  • Tools hub
  • Airport indexes

© 2026 WorldClockTools. 保留所有權利。

城市資料來源:GeoNames(CC BY 4.0)。時區資料來源:IANA 時區資料庫。

  1. WorldClockTools
  2. Tools
  3. Unix timestamp

Developer tool

Unix timestamp converter.

A Unix timestamp is the number of seconds since the epoch — 00:00:00 UTC on 1 January 1970 — and it is the format almost every database, log file, JWT, cookie expiry, and HTTP cache header uses internally. This page gives you a live current timestamp, two-way conversion between epoch and human-readable dates, and copy-pasteable snippets for the languages you actually use. Paste any 10-digit (seconds) or 13-digit (milliseconds) value and we auto-detect the unit; pick a date and we hand you back seconds, milliseconds, ISO 8601, and RFC 2822 in one step.

Live

Current Unix timestamp (sec)

----------

Milliseconds

-------------

Timestamp → Date

Enter a Unix timestamp to convert.

Date → Timestamp

Pick a date and time to convert.

Snippets

In your favourite language

Python

Current timestamp

import time
time.time()  # seconds (float)

Timestamp → date

from datetime import datetime, timezone
datetime.fromtimestamp(ts, tz=timezone.utc)

Date → timestamp

int(datetime(2026, 1, 1, tzinfo=timezone.utc).timestamp())

JavaScript

Current timestamp

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

Timestamp → date

new Date(ts * 1000).toISOString()

Date → timestamp

Math.floor(new Date('2026-01-01T00:00:00Z').getTime() / 1000)

Bash

Current timestamp

date +%s

Timestamp → date

date -u -d @1700000000  # GNU
date -u -r 1700000000   # BSD/macOS

Date → timestamp

date -u -d '2026-01-01' +%s  # GNU

Go

Current timestamp

time.Now().Unix()

Timestamp → date

time.Unix(ts, 0).UTC()

Date → timestamp

time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC).Unix()

PostgreSQL

Current timestamp

SELECT EXTRACT(EPOCH FROM NOW())::bigint;

Timestamp → date

SELECT to_timestamp(1700000000) AT TIME ZONE 'UTC';

Date → timestamp

SELECT EXTRACT(EPOCH FROM TIMESTAMP '2026-01-01 00:00:00')::bigint;

MySQL

Current timestamp

SELECT UNIX_TIMESTAMP();

Timestamp → date

SELECT FROM_UNIXTIME(1700000000);

Date → timestamp

SELECT UNIX_TIMESTAMP('2026-01-01 00:00:00');

Questions

Frequently asked questions

What is a Unix timestamp?
A Unix timestamp (also called epoch time or POSIX time) is the number of seconds that have elapsed since 00:00:00 UTC on Thursday, 1 January 1970, not counting leap seconds. It is a single integer that uniquely identifies a moment in time independent of timezone or calendar quirks, which is why it is the canonical timestamp format in databases, APIs, log files, and cookies across virtually every operating system.
Seconds vs milliseconds — which one am I looking at?
Unix-style timestamps are commonly stored in seconds (10 digits today, e.g. 1700000000) or milliseconds (13 digits, e.g. 1700000000000). JavaScript's Date.now() returns milliseconds; most server languages and databases default to seconds. As a rule of thumb: a 10-digit integer is seconds, a 13-digit integer is milliseconds. Microseconds (16 digits) and nanoseconds (19 digits) appear in some logging systems. This converter auto-detects based on length.
What is the Y2K38 bug?
Many older systems store Unix timestamps as a signed 32-bit integer, which can only represent times up to 03:14:07 UTC on 19 January 2038 before overflowing into a negative number. This is the Y2K38 problem (or 'epochalypse'). Modern 64-bit systems use 64-bit integers and are not affected for any practical timeframe, but legacy embedded firmware, file systems, and database columns may still need patches before 2038.
Can Unix timestamps be negative?
Yes. Negative Unix timestamps represent moments before the epoch — i.e. before 1 January 1970 UTC. JavaScript, Python, Go and most modern languages handle negative timestamps natively. Some legacy systems and database drivers reject negative values, however, so when working with historical dates it is safer to store them as ISO 8601 strings or use a wider epoch.
Do Unix timestamps account for leap seconds?
No. By definition, Unix time ignores leap seconds: every Unix day is exactly 86400 seconds, even on the rare days when UTC inserts a leap second. Most systems handle the discontinuity by either smearing the leap second across many hours (Google, AWS) or repeating the last second. For everyday application logic this never matters, but high-precision astronomy or finance code should consult TAI or UTC directly.
What timezone is a Unix timestamp in?
None — and that is the point. A Unix timestamp identifies an absolute instant in time. It only becomes a date in a particular timezone when you format it for display. Storing timestamps as integers in your database and only converting to local time at the edges of your application is the standard pattern for avoiding DST bugs.