Skip to content

Unix Timestamp Reference

Notable timestamps, other epochs and how to get the time in code.

About Unix timestamp reference

Unix time counts the seconds since the Unix epoch, 00:00:00 UTC on 1 January 1970, ignoring leap seconds: every day is exactly 86,400 seconds. Because it's a single number that's the same everywhere at a given moment, it's the standard way to store and compare instants in databases, logs, file systems, JWT claims and APIs.

The year 2038 problem comes from storing Unix time in a signed 32-bit integer, which can count up to 2,147,483,647: 03:14:07 UTC on 19 January 2038. One second later the value wraps around to a negative number that reads as December 1901. Modern 64-bit operating systems, languages and databases use 64-bit time, but embedded devices, old file formats and database columns declared as 32-bit integers can still be affected.

Notable Unix timestamps

TimestampDate and time (UTC)Why it's notable
-21474836481901-12-13 20:45:52 UTCSmallest signed 32-bit timestamp
01970-01-01 00:00:00 UTCThe Unix epoch
9466848002000-01-01 00:00:00 UTCStart of the year 2000
10000000002001-09-09 01:46:40 UTCUnix time reached one billion
12345678902009-02-13 23:31:30 UTCThe famous 1234567890
15000000002017-07-14 02:40:00 UTC1.5 billion seconds
16000000002020-09-13 12:26:40 UTC1.6 billion seconds
17000000002023-11-14 22:13:20 UTC1.7 billion seconds
18000000002027-01-15 08:00:00 UTC1.8 billion seconds
20000000002033-05-18 03:33:20 UTC2 billion seconds
21474836472038-01-19 03:14:07 UTCLargest signed 32-bit timestamp: the year 2038 problem
42949672952106-02-07 06:28:15 UTCLargest unsigned 32-bit timestamp

Other epochs

Systems that count time from a different starting point, and how far it is from the Unix epoch.

SystemEpochUnitOffset from Unix
Unix, POSIX, Linux, macOS1970-01-01 00:00:00 UTCSeconds0
JavaScript Date, Java1970-01-01 00:00:00 UTCMilliseconds0 (× 1000)
Windows FILETIME, NTFS1601-01-01 00:00:00 UTC100-nanosecond intervals11644473600 s before Unix
.NET DateTime ticks0001-01-01 00:00:00100-nanosecond intervals62135596800 s before Unix
NTP1900-01-01 00:00:00 UTCSeconds2208988800 s before Unix
GPS time1980-01-06 00:00:00 UTCSeconds (no leap seconds)315964800 s after Unix
Apple Cocoa, Core Data2001-01-01 00:00:00 UTCSeconds978307200 s after Unix
Classic Mac OS, HFS+1904-01-01 00:00:00Seconds2082844800 s before Unix
Excel (Windows default)Serial day 1 = 1900-01-01DaysDay 25569 = 1970-01-01

Durations in seconds

SpanSeconds
1 minute60
1 hour3,600
1 day86,400
1 week604,800
30 days2,592,000
365 days31,536,000
366 days (leap year)31,622,400
Average Gregorian year31,556,952

Current Unix time in code

LanguageCode
JavaScriptMath.floor(Date.now() / 1000)
Pythonint(time.time())
Bashdate +%s
Gotime.Now().Unix()
JavaInstant.now().getEpochSecond()
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()
PHPtime()
RubyTime.now.to_i
RustSystemTime::now().duration_since(UNIX_EPOCH)?.as_secs()
PostgreSQLSELECT extract(epoch FROM now())::bigint;
MySQLSELECT UNIX_TIMESTAMP();
SQLiteSELECT unixepoch();
Date from timestamp (GNU)date -u -d @1700000000
Date from timestamp (macOS, BSD)date -u -r 1700000000

Good to know

Seconds or milliseconds?

A current timestamp in seconds has 10 digits; in milliseconds, 13. JavaScript (Date.now()) and Java (System.currentTimeMillis()) use milliseconds, most other languages and Unix tools use seconds. Mixing them up gives dates in January 1970 or thousands of years ahead.

More references