DevToolsForYou

Unix Timestamps Cheatsheet

A quick reference for Unix epoch time — what it is, common conversions, date math, and language snippets for working with timestamps.

Updated Apr 11, 2026
Try the Epoch / Unix Converter

Sections

  1. What Is a Unix Timestamp?
  2. Common Reference Timestamps
  3. Time Unit Conversions
  4. Language Snippets
  5. Parse & Format Snippets

What Is a Unix Timestamp?

ConceptDetail
DefinitionNumber of seconds elapsed since 1970-01-01 00:00:00 UTC (the Unix epoch)
Time zoneAlways UTC — independent of local time zones
GranularitySeconds (Unix), milliseconds (JavaScript), microseconds (Python datetime), nanoseconds (Go)
Signed 32-bitOverflows on 2038-01-19 03:14:07 UTC (Year 2038 problem)
Signed 64-bitSafe for ~292 billion years — use this

Common Reference Timestamps

Unix TimestampDate / Time (UTC)
01970-01-01 00:00:00 — the epoch
864001970-01-02 00:00:00 — one day after epoch
10000000002001-09-09 01:46:40
12345678902009-02-13 23:31:30
17000000002023-11-14 22:13:20
21474836472038-01-19 03:14:07 — max 32-bit signed int
41024448002100-01-01 00:00:00

Time Unit Conversions

UnitSeconds
1 minute60
1 hour3,600
1 day86,400
1 week604,800
30 days2,592,000
1 year (365 days)31,536,000
1 year (365.25 days)31,557,600

Language Snippets

LanguageGet Current Timestamp
JavaScriptDate.now() // milliseconds Math.floor(Date.now() / 1000) // seconds
Pythonimport time; int(time.time())
Gotime.Now().Unix()
Bashdate +%s
SQL (PostgreSQL)EXTRACT(EPOCH FROM NOW())::BIGINT
SQL (MySQL)UNIX_TIMESTAMP()
RubyTime.now.to_i
PHPtime()

Parse & Format Snippets

LanguageParse Timestamp → Date
JavaScriptnew Date(ts * 1000).toISOString()
Pythondatetime.utcfromtimestamp(ts)
Gotime.Unix(ts, 0).UTC()
Bashdate -d @<ts> -u (GNU) / date -r <ts> -u (macOS)
Related guidesAll guides →