tooliv

Timestamp Converter

Convert Unix timestamp to date and vice versa

Timestamp Converter

Why does Unix time start in 1970?

Unix was developed in 1969-1970, and the developers chose January 1, 1970 as a convenient starting point.

What does a negative Unix timestamp mean?

A date before January 1, 1970. For example, -86400 is December 31, 1969.

How do I get a timestamp in JavaScript?

Use Date.now() for milliseconds or Math.floor(Date.now()/1000) for seconds.

What Is a Unix Timestamp?

A Unix timestamp is the number of seconds (or milliseconds) that have elapsed since January 1, 1970, 00:00:00 UTC -- known as the Unix epoch. It's the universal way computers store time: a single integer that's unambiguous, timezone-independent, and easy to do math with.

Seconds vs. Milliseconds: How to Tell the Difference

A 10-digit number is a Unix timestamp in seconds (e.g., 1700000000). A 13-digit number is milliseconds (e.g., 1700000000000). JavaScript's Date.now() returns milliseconds; most Unix/Linux system calls use seconds. When an API gives you a timestamp, count the digits to figure out which one you're dealing with.

Why Timestamps Beat Date Strings

Storing dates as strings creates headaches: Which format? MM/DD/YYYY or DD/MM/YYYY or YYYY-MM-DD? What timezone? When you sort them alphabetically, do they sort chronologically? Timestamps solve all of this. They're just numbers -- trivially sortable, comparable with a simple subtraction, and timezone-neutral. A timestamp of 1700000000 means the same moment in every country on Earth.

Timezones and UTC: The Right Way to Handle Time

Unix timestamps are always UTC. If you're in UTC+9 (Korea), you add 9 hours (32,400 seconds) to convert to local time. The golden rule for any system that handles time: store in UTC, display in local time. Convert as late as possible -- only at the point of display. This prevents bugs where different servers in different timezones disagree about what time it is.

The Y2K38 Problem (and Why It Matters Less Now)

In 2038, 32-bit Unix timestamps will overflow. On January 19, 2038 at 03:14:07 UTC, a 32-bit signed integer can't go any higher -- it wraps around to a large negative number. 64-bit systems handle timestamps up to the year 292 billion, so modern systems are fine. But some legacy embedded systems and old databases still use 32-bit timestamps.

Frequently Asked Questions

Why does Unix time start in 1970?

Unix was developed in 1969-1970, and the developers chose January 1, 1970 as a convenient starting point.

What does a negative Unix timestamp mean?

A date before January 1, 1970. For example, -86400 is December 31, 1969.

How do I get a timestamp in JavaScript?

Use Date.now() for milliseconds or Math.floor(Date.now()/1000) for seconds.

Related Tools