December 6, 2026

Unix Timestamps: What 1770422400 Means and How the date Command Reads It

A mechanical flip counter with blank digit flaps on a dark desk

The number 1770422400 is a date. Fed to the Linux date command as date -u -d @1770422400, it comes back as midnight UTC on February 7, 2026. Hand the same number to JavaScript’s new Date() and the answer is January 21, 1970, about eleven in the morning. Neither tool is broken. They disagree about the unit, and that one disagreement is behind a large share of the timestamp bugs that turn up in logs, databases and APIs. Every command below was run on GNU coreutils 9.4, and the output shown is what it printed.

Video: Numberphile on YouTube

Seconds since a fixed moment

The epoch

A Unix timestamp counts seconds from a single agreed starting point. The POSIX standard, maintained by The Open Group, defines the Epoch as “The time zero hours, zero minutes, zero seconds, on January 1, 1970 Coordinated Universal Time (UTC).”

Zero is that instant. One is a second later. Negative numbers run backward: date -u -d @-1 printed Wed Dec 31 23:59:59 UTC 1969.

No time zone inside the number

Because the count starts at a moment defined in UTC, the number itself has no time zone. The same value is the same instant everywhere on Earth. Only the display changes:

TZ=America/New_York date -d @1770422400 '+%F %T %Z'   # 2026-02-06 19:00:00 EST
TZ=Asia/Tokyo       date -d @1770422400 '+%F %T %Z'   # 2026-02-07 09:00:00 JST

Same instant, two calendar days. That is the main reason servers store timestamps rather than local date strings: two machines in different zones can compare numbers without arguing about whose midnight counts.

Landmark numbers

A few values from the test run, all UTC:

Timestamp Date
0 Thu Jan 1 00:00:00 1970
1000000000 Sun Sep 9 01:46:40 2001
1234567890 Fri Feb 13 23:31:30 2009
1770422400 Sat Feb 7 00:00:00 2026
2147483647 Tue Jan 19 03:14:07 2038

That last one matters, and it gets its own section below.

Round analog wall clock pointing at 10:09

Converting with the date command

Timestamp to date

GNU’s date examples page shows the @ syntax, which tells date the input is a count of seconds. Its example date -u -d @1595289600 +"%F %T %z" prints 2020-07-21 00:00:00 +0000. Leaving off -u shows local time instead.

Date to timestamp

Going the other way uses the +%s format:

date -u -d '2026-02-07 00:00:00' +%s    # 1770422400
date -u -d '2026-02-07 09:30' +%s       # 1770456600

Subtracting gives elapsed time with no calendar arithmetic: 1770456600 minus 1770422400 is 34,200 seconds, nine and a half hours. Shell arithmetic $(( (b - a) / 3600 )) printed 9, because integer division drops the half.

The UTC trap

Without -u or an explicit zone, date -d '2026-02-07' means midnight in the machine’s local zone. On a server set to New York, that is five hours later than UTC midnight. Scripts that build timestamps from plain dates should always say which zone they mean, either with -u or by writing the zone into the string, as GNU’s own examples do with +0000 and UTC.

Seconds, milliseconds and the 1970 bug

Different units in different places

date +%s and most Unix tools work in seconds. Python’s time.time() does too, returning “the time in seconds since the epoch as a floating-point number.” JavaScript counts milliseconds: MDN says Date.now() “returns the number of milliseconds elapsed since the epoch.”

What happens when they meet

Run in Node.js for this post:

new Date(1770422400).toISOString()        // 1970-01-21T11:47:02.400Z
new Date(1770422400 * 1000).toISOString() // 2026-02-07T00:00:00.000Z

A seconds value passed where milliseconds are expected lands a few weeks after the epoch. That is the source of all those “January 1970” dates that show up in apps and dashboards. The reverse mistake, milliseconds treated as seconds, produces a year tens of thousands of years in the future.

A quick way to tell

Count digits. A current timestamp in seconds has 10 digits; in milliseconds, 13. In Node, Date.now() > 1e12 returned true, a cheap check that a value is in milliseconds. Microseconds (16 digits) and nanoseconds (19) also appear, in database columns and tracing tools.

Desk calendar with business symbols and alarm clock

Leap seconds, which Unix time ignores

Every day is 86,400 seconds

The Earth’s rotation doesn’t keep perfect time, so UTC has occasionally added a leap second, a 61-second minute. Unix time doesn’t count them. POSIX’s section on seconds since the Epoch states that “each and every day shall be accounted for by exactly 86400 seconds,” and calls the value something that “approximates the number of seconds that have elapsed since the Epoch.”

Python’s documentation is blunter: on all POSIX-compliant platforms, leap seconds are excluded from the count.

What date does with 23:59:60

A leap second was added at the end of 2016. On the test machine:

date -d '2016-12-31 23:59:60'   # date: invalid date '2016-12-31 23:59:60'
date -u -d '2017-01-01' +%s     # 1483228800

The GNU examples page describes this as the behavior of “typical” systems, and shows “atypical” ones that count leap seconds and return different numbers, such as 1483228827 for that same midnight. The practical upshot: subtracting two Unix timestamps across a leap second is off by one, and almost nothing cares.

Daylight saving time, which Unix time doesn’t have

The missing hour

In 2026, U.S. clocks spring forward on March 8. Ask date about a time inside the gap:

TZ=America/New_York date -d '2026-03-08 02:30'
# date: invalid date '2026-03-08 02:30'

2:30 a.m. never happens in New York that morning. The timestamps around it are continuous, though:

TZ=America/New_York date -d @1772949600 '+%F %T %Z'   # 2026-03-08 01:00:00 EST
TZ=America/New_York date -d @1772953200 '+%F %T %Z'   # 2026-03-08 03:00:00 EDT

Those two numbers are 3,600 seconds apart: one real hour, two hours on the wall clock.

Why this favors storing timestamps

A local wall-clock time can be ambiguous (in autumn, 1:30 a.m. happens twice) or impossible (the spring gap). A Unix timestamp is never either. Code that stores timestamps and converts to local time only for display avoids a whole class of twice-a-year bugs.

Vintage computer with a CRT monitor and floppy drives

The 2038 problem

A 32-bit counter runs out

Many older systems stored timestamps in a signed 32-bit integer, whose largest value is 2,147,483,647. The test table above shows what that is: 03:14:07 UTC on January 19, 2038. One second later, a 32-bit counter overflows to its most negative value. A Python check of that wraparound gave −2,147,483,648, which as a date is 20:45:52 UTC on December 13, 1901. The Wikipedia article on the problem gives the same two moments.

What has already been fixed

The test machine’s date printed Tue Jan 19 03:14:08 UTC 2038 for 2147483648 without complaint, because 64-bit Linux uses a 64-bit time value. The same article says Linux added 64-bit time support on 32-bit architectures “starting with version 5.6 of 2020,” and that glibc 2.34 “added support for using 64-bit time_t on 32-bit platforms.”

The remaining risk sits in places that don’t get updated: embedded devices, old file formats and database columns declared as 32-bit integers. A signed 64-bit counter, by a quick calculation, lasts about 292 billion years.

Unsigned is not a full fix

Some formats use an unsigned 32-bit value instead, which can’t go negative. That buys time, not safety: Python puts the end of an unsigned 32-bit count at 06:28:15 UTC on February 7, 2106.

Everyday uses

Comparing file times

File modification times are Unix timestamps underneath. Setting one with touch -d @1770422400 file.txt and reading it with stat -c '%Y' file.txt returned 1770422400, and find . -newermt '2026-02-01' matched the file. Backups, cache cleaners and build tools all compare these numbers.

In a database

SQLite, which ships inside countless apps, reads Unix time directly. Its date and time functions page says the “unixepoch” modifier makes a number be read “as Unix Time – the number of seconds since 1970,” and that the functions “use UTC or ‘zulu’ time internally.” In the sqlite3 shell on the test machine (SQLite 3.45.1):

SELECT datetime(1770422400, 'unixepoch');              -- 2026-02-07 00:00:00
SELECT datetime(1770422400, 'unixepoch', 'localtime'); -- 2026-02-06 19:00:00
SELECT strftime('%s', '2026-02-07 00:00:00');          -- 1770422400
SELECT datetime(1770422400000, 'unixepoch');           -- (empty)

The last line is the milliseconds mistake again, this time without even a wrong date to warn anyone. SQLite returned nothing at all, which in a report or export can look like missing data rather than a units error. The second line also shows the zone rule in action: the localtime modifier converted to the machine’s zone, which was set to New York for that run.

Logging and naming files

A timestamp in a filename sorts correctly as text and never collides on a daylight-saving change: backup-$(date -u +%s).tar.gz. For human readers, date -u +%Y%m%dT%H%M%SZ gives a sortable form that also says what it is.

Reading other people’s numbers

When a log or API hands over a bare number, three checks settle it: count the digits to get the unit, convert with date -u -d @N to see if the result is plausible, and confirm the zone before showing it to anyone. A ten-digit number that converts to 1970 is a units bug almost every time.

Sources

  • The Open Group, POSIX Base Definitions, Chapter 3 (Definitions), “Epoch”: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap03.html
  • The Open Group, POSIX Base Definitions, Chapter 4, “Seconds Since the Epoch”: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap04.html
  • GNU Coreutils manual, “Examples of date”: https://www.gnu.org/software/coreutils/manual/html_node/Examples-of-date.html
  • Python documentation, time module: https://docs.python.org/3/library/time.html
  • MDN Web Docs, Date.now(): https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/now
  • SQLite, “Date And Time Functions”: https://www.sqlite.org/lang_datefunc.html
  • Wikipedia, “Year 2038 problem”: https://en.wikipedia.org/wiki/Year_2038_problem

920 Posts

Peter Kalafatis writes and edits X9M8. He holds a bachelor's degree from LIU Post and a master's in Media Studies from The New School, with academic work in the philosophy of science, human behavior, AI, and memetics.

View All Posts

Leave a Reply

Your email address will not be published. Required fields are marked *