nicetool.dev logo
...

What is Unix Timestamp?

The Unix Timestamp (also known as POSIX time or Epoch time) is a system for tracking time as a running total of seconds. This count starts at the 'Unix Epoch'. It is the standard time format used by most computer systems, servers, and databases worldwide.

The Unix Epoch

The starting point is defined as 00:00:00 UTC on January 1, 1970. Dates before this time are represented as negative numbers.

Common Time-to-Seconds Conversions

Human Readable TimeSeconds
1 Hour3,600 Seconds
1 Day86,400 Seconds
1 Week604,800 Seconds
1 Month (30.44 days)2,629,743 Seconds
1 Year (365.24 days)31,556,926 Seconds

The Year 2038 Problem

Similar to the Y2K bug, the 'Year 2038 problem' is expected to occur on January 19, 2038. At this moment, the Unix Time will exceed the maximum value of a 32-bit signed integer. Legacy 32-bit systems may interpret this date as 1901, causing critical errors.

03:14:07 UTC 19/01/2038
Max Int32: 2,147,483,647

Common Use Cases

Databases

Storing time as integers (INT) saves space and significantly improves query/sorting performance.

File Systems & Logs

Naming backup files or system logs to ensure uniqueness and easy chronological sorting.

APIs & Tokens

Used in JWTs (JSON Web Tokens) to define expiration times (exp claim) and validity periods.

How to use the Unix Time

  1. 1

    The live clock at the top shows the current Unix time in seconds and milliseconds. Use it when you need "now" as a timestamp for a test or a database query.

  2. 2

    Paste a timestamp into the converter. The tool detects whether it is in seconds (10 digits) or milliseconds (13 digits) and shows the date in UTC, in your local time zone and as a relative time such as "3 days ago".

  3. 3

    To go the other way, switch to Date mode, enter the year, month, day and time, pick a time zone and press Convert to get the matching timestamp.

  4. 4

    Copy any value with one click. The world clock below shows the same moment in major cities, which helps when a log line from a server in another region needs to be matched with your local time.

Practical examples

Reading log files

Server logs and monitoring tools often store events as 1712345678. Paste the number to see the exact UTC and local time of the incident.

Debugging JWT expiry

The exp and iat claims of a JSON Web Token are Unix timestamps in seconds. Converting them shows at a glance whether a token has already expired.

Writing database queries

Need all orders created after 1 March 2026 00:00 UTC? Convert the date to 1772323200 and use it in a WHERE clause on an integer column.

Checking API responses

JavaScript returns milliseconds (Date.now()), while most backends return seconds. The converter shows both, so mixing them up by a factor of 1000 is easy to spot.

Frequently asked questions

What is a Unix timestamp?+

It is the number of seconds that have passed since 1 January 1970 00:00:00 UTC, called the Unix epoch. Because it is a single number without a time zone, it is the easiest way for computers to store and compare moments in time.

Seconds or milliseconds, how do I tell?+

Timestamps for current dates have 10 digits in seconds and 13 digits in milliseconds. Unix tools, PHP and most databases use seconds; JavaScript and Java use milliseconds.

What is the year 2038 problem?+

Systems that store the timestamp as a signed 32-bit integer overflow on 19 January 2038 at 03:14:07 UTC. Modern languages and 64-bit databases are not affected, but older embedded systems and some file formats still are.

Do Unix timestamps include leap seconds?+

No. Unix time assumes every day has exactly 86,400 seconds, so leap seconds are not counted. For almost all applications this makes no practical difference.

From the blog