Unix Time & Date Format Cheat Sheet

What Unix time is, how to recognise seconds, milliseconds and nanoseconds, every common date format, and how to convert in your language.

Cheat sheetPrintableFree, no login

Updated 28 October 2026

Convert any timestamp or date, in any time zone, with code snippets for your language.

Open the epoch converter

What Unix time is

Unix time (also called epoch time or POSIX time) counts the seconds since 00:00:00 UTC on 1 January 1970. It is the same number everywhere in the world at the same moment — time zones only matter when you turn it into a date. Leap seconds are ignored, so every day is exactly 86,400 seconds.

UnitDigits todayExample (28 Oct 2026, 00:00 UTC)Used by
Seconds101793145600Unix, PHP time(), Go .Unix(), JWT exp
Milliseconds131793145600000JavaScript Date.now(), Java currentTimeMillis()
Microseconds161793145600000000PostgreSQL timestamps, Python datetime
Nanoseconds191793145600000000000Go .UnixNano(), Python time.time_ns()

The epoch converter detects the unit from the number of digits.

Notable timestamps

TimestampDate (UTC)Why it matters
01970-01-01 00:00:00 UTCThe Unix epochTry ↗
10000000002001-09-09 01:46:40 UTCUnix time reached a billionTry ↗
12345678902009-02-13 23:31:30 UTCThe famous "1234567890" momentTry ↗
17000000002023-11-14 22:13:20 UTCTry ↗
18000000002027-01-15 08:00:00 UTCTry ↗
20000000002033-05-18 03:33:20 UTCTwo billion secondsTry ↗
21474836472038-01-19 03:14:07 UTCLargest signed 32-bit value — the Year 2038 problemTry ↗
42949672952106-02-07 06:28:15 UTCLargest unsigned 32-bit valueTry ↗
-21474836481901-12-13 20:45:52 UTCSmallest signed 32-bit valueTry ↗

Durations in seconds

DurationSecondsMilliseconds
1 minute6060000
1 hour36003600000
1 day8640086400000
1 week604800604800000
30 days25920002592000000
365 days3153600031536000000
366 days (leap year)3162240031622400000

Date and time formats

FormatExampleWhere you see it
ISO 8601 / RFC 3339 (UTC)2026-10-28T09:30:00ZAPIs, JSON, logs. The safest choice
ISO 8601 with offset2026-10-28T15:00:00+05:30Same moment, local wall-clock time
ISO 8601 date only2026-10-28Birthdays, due dates
ISO week date2026-W44-3Week-based planning (Wednesday of week 44)
ISO ordinal date2026-301Day 301 of the year
RFC 2822Wed, 28 Oct 2026 09:30:00 +0000Email Date: headers, RSS
HTTP date (RFC 7231)Wed, 28 Oct 2026 09:30:00 GMTLast-Modified, Expires, cookies
SQL DATETIME2026-10-28 09:30:00MySQL, SQLite — no time zone stored
Unix seconds1793179800Databases, JWT, file systems

RFC 3339 is a strict profile of ISO 8601: it always has a date, a time and an offset (Z or ±hh:mm).

Format codes: strftime, Java and Go

Meaningstrftime (C, Python, PHP, Bash)Java / KotlinGo layout
Year, 4 digits%Yyyyy2006
Month 01–12%mMM01
Day 01–31%ddd02
Hour 00–23%HHH15
Hour 01–12%Ihh03
Minute%Mmm04
Second%Sss05
Fraction of a second%f (microseconds, Python)SSS (ms).000
AM / PM%paPM
Weekday, short%aEEEMon
Month, short%bMMMJan
UTC offset%z (+0530)XXX (+05:30)-07:00
Time zone name%ZzMST
ISO 8601 shortcut%Y-%m-%dT%H:%M:%S%zDateTimeFormatter.ISO_OFFSET_DATE_TIMEtime.RFC3339

Go formats by example: its reference time is Mon Jan 2 15:04:05 MST 2006 (1 2 3 4 5 6 7).

Unix time in code

LanguageCurrent Unix time (seconds)Timestamp → date
JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000)
Pythonint(time.time())datetime.fromtimestamp(ts, tz=timezone.utc)
Gotime.Now().Unix()time.Unix(ts, 0).UTC()
JavaInstant.now().getEpochSecond()Instant.ofEpochSecond(ts)
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()DateTimeOffset.FromUnixTimeSeconds(ts)
PHPtime()date('c', $ts)
PostgreSQLextract(epoch FROM now())::bigintto_timestamp(ts)
MySQLUNIX_TIMESTAMP()FROM_UNIXTIME(ts)
Bashdate +%sdate -u -d @ts (Linux), date -u -r ts (macOS)

Gotchas

Frequently asked questions

What is the current Unix timestamp?
The epoch converter shows it live, updating every second. In code: Math.floor(Date.now() / 1000) in JavaScript or date +%s in a terminal.
Is Unix time in seconds or milliseconds?
The standard is seconds. JavaScript, Java and some APIs use milliseconds instead. A 10-digit number is seconds, a 13-digit number is milliseconds.
Does Unix time include leap seconds?
No. Unix time treats every day as exactly 86,400 seconds, so leap seconds are not counted.
What happens in 2038?
At 03:14:07 UTC on 19 January 2038, Unix time passes 2,147,483,647, the largest number a signed 32-bit integer can hold. Old 32-bit systems will wrap to 1901. Modern 64-bit systems are not affected.
Is ISO 8601 the same as RFC 3339?
Almost. RFC 3339 is a stricter subset of ISO 8601 for internet protocols: a full date and time with an offset, such as 2026-10-28T09:30:00Z.
✓ Copied!