🕐 Unix Timestamp Converter

Ad Space - Top (728x90)
Current Unix Timestamp (live)

Timestamp → Date & Time

HintEnter a timestamp to convert automatically

Date & Time → Timestamp

HintSelect a date to convert automatically

Quick Timestamp Shortcuts

Click to get common time point timestamps (local timezone):

HintClick a button above to get the timestamp

Relative Time Calculator

RelativeEnter a timestamp to display

Quick offset calculation (from now):

HintClick a button above to calculate

Batch Timestamp Conversion

Enter one timestamp per line (auto-detects seconds/milliseconds):

Batch Results

Results will appear here...
Ad Space - Middle (728x90)

Unix Timestamp Knowledge

What is a Unix Timestamp

A Unix timestamp is the number of seconds (or milliseconds) elapsed since January 1, 1970 00:00:00 UTC (Coordinated Universal Time) to a given moment. It is a cross-platform, cross-programming-language unified way to represent time, independent of any timezone. It is widely used in database storage, API communication, log recording, cache expiration, and more.

A second-level timestamp is a 10-digit number (e.g., 1700000000); a millisecond-level timestamp is a 13-digit number (e.g., 1700000000000). JavaScript's Date.now() returns milliseconds by default, while C's time() and PHP's time() return seconds.

The Origin: January 1, 1970

The starting point of the Unix timestamp, 1970-01-01 00:00:00 UTC, is known as the Unix Epoch. This convention dates back to the early development of the Unix operating system (around 1969-1971). According to Unix pioneers Dennis Ritchie and Ken Thompson, 1970 was chosen as the starting point because it was a clean, rounded decade that made manual estimation convenient. Since then, Unix and its derivative systems (Linux, macOS, BSD, etc.) have all used this moment as the baseline for time calculation.

The Year 2038 Problem (Y2K38)

On 32-bit systems, Unix timestamps are typically stored as a 32-bit signed integer (int32_t), whose maximum value is 2147483647, corresponding to January 19, 2038 03:14:07 UTC. After this moment, the integer overflows and the timestamp becomes negative, causing systems to "roll back" time to 1901, leading to software failures. This is the famous Year 2038 problem (also called Y2K38).

The solution is to use 64-bit timestamps (int64_t, or time_t on 64-bit systems). A 64-bit timestamp can represent approximately 292 billion years, which is more than enough for any practical need. Modern 64-bit operating systems and most mainstream programming languages have migrated to 64-bit timestamps, though some embedded and legacy systems still need attention.

How to Get a Timestamp in Common Programming Languages

LanguageSecondsMilliseconds
JavaScriptMath.floor(Date.now()/1000)Date.now()
Pythonint(time.time())int(time.time()*1000)
JavaInstant.now().getEpochSecond()System.currentTimeMillis()
PHPtime()intval(microtime(true)*1000)
Gotime.Now().Unix()time.Now().UnixMilli()
C/C++time(NULL)use clock_gettime
RubyTime.now.to_iTime.now.to_i * 1000
SwiftInt(Date().timeIntervalSince1970)Int(Date().timeIntervalSince1970 * 1000)
SQL (MySQL)UNIX_TIMESTAMP()UNIX_TIMESTAMP(NOW(3))*1000
Shell (Bash)date +%sdate +%s%3N

Common Use Cases

Frequently Asked Questions

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 (the Unix Epoch). It is a cross-platform, cross-language unified way to represent time, widely used in database storage, API communication, and log recording.

What year does the Unix timestamp start from?

The Unix timestamp starts from January 1, 1970 00:00:00 UTC, known as the Unix Epoch. The maximum timestamp a 32-bit signed integer can represent is 2147483647, corresponding to January 19, 2038 03:14:07 UTC.

What is the Year 2038 problem (Y2K38)?

The Year 2038 problem refers to systems that store Unix timestamps as 32-bit signed integers, which will overflow after January 19, 2038 03:14:07 UTC, causing the time to roll back to 1901. The solution is to use 64-bit timestamps; modern 64-bit systems are unaffected.

What is the difference between second and millisecond timestamps?

A second-level timestamp is a 10-digit number (e.g., 1700000000), while a millisecond-level timestamp is a 13-digit number (e.g., 1700000000000). JavaScript's Date.now() returns milliseconds, while Linux's time() and PHP's time() return seconds. This tool auto-detects and supports both formats.

Do timestamps have a timezone?

Unix timestamps themselves have no timezone concept; they are always based on UTC. The same timestamp has the same value anywhere in the world. Timezones only affect the display when converting a timestamp to a human-readable date and time. This tool supports UTC, local, and custom timezone switching.

How do I get the current timestamp in JavaScript?

In JavaScript, use Date.now() for a millisecond timestamp, and Math.floor(Date.now()/1000) for a second timestamp. You can also use new Date().getTime() or Date.parse(dateString) to get a timestamp for a specific time.

Ad Space - Bottom (728x90)