Unix and JavaScript timestamps

7 Sep 2025

Unix time is the number of seconds elapsed since midnight UTC on January 1, 1970. For example, Unix time was 17‍56684800 on September 1, 2025 at midnight UTC. The counter is independent of the time zone, holding the same value at the same moment in different timezones. It is widely used in C and C++ programming languages, databases (MySQL, PostgreSQL, and SQLite), and file systems (ext3, HFS+, and Reiserfs).

The counter is typically stored in a 32-bit signed integer, so it can represent dates from December 13, 1901 to January 19, 2038. In 2038, the counter will reach 231−1 and overflow, which is known as the year 2038 problem. Fortunately, most modern implementations have already switched to 64-bit integers.

Java and JavaScript use the number of milliseconds, not seconds, to represent time since 1970, resulting in a counter with more digits (e.g., 17‍56684800000) that fits in a 64-bit integer. Some other implementations (e.g., Apple File System) count the number of nanoseconds instead.

The Unix developers chose the epoch of January 1, 1970 because they created the first version of Unix in 1970, so they only needed to represent dates after 1970. Other platforms chose a date close to the introduction of the Gregorian calendar, for example, the Windows counter (the FILETIME structure) starts on January 1, 1601 and the UUID version 1 counter starts on October 15, 1582.

You can use the following functions in different programming languages to get the current Unix timestamp value:

Decode Unix timestamp

Aba Search and Replace can convert Unix/JavaScript timestamps to a date in popular formats including ISO 8601 / RFC 3339, RFC 1123 / RFC 7231, and the Windows system format. It can also perform the reverse conversion and generate the current timestamp.

Aba Search and Replace screenshot

Stop jumping between browser tabs and random online tools. Aba Search and Replace is your Swiss army knife for fast, safe text updates across multiple files and data conversions, with all your data staying on your computer. Built for developers, testers, and analysts.

This is a blog about Aba Search and Replace, a tool for replacing text in multiple files.