Developer

Unix Timestamp Converter

Convert Unix seconds, milliseconds, and readable dates, with common code snippets for developers.

Current seconds
1783329855
Current milliseconds
1783329855125
Local time
2026/7/6 17:24:15
UTC time
Mon, 06 Jul 2026 09:24:15 GMT

Code

Timestamp snippets

LanguageGet current Unix secondsCopy
JavaScriptMath.floor(Date.now() / 1000)
TypeScriptconst unixSeconds: number = Math.floor(Date.now() / 1000)
Ctime_t unix_seconds = time(NULL);
C++auto unix_seconds = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
Pythonint(time.time())
JavaInstant.now().getEpochSecond()
SwiftInt(Date().timeIntervalSince1970)
Objective-C(NSInteger)[[NSDate date] timeIntervalSince1970]
PHPtime()
Gotime.Now().Unix()
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()
KotlinInstant.now().epochSecond
MySQLUNIX_TIMESTAMP()
PostgreSQLEXTRACT(EPOCH FROM NOW())::bigint
Shelldate +%s

FAQ

Questions people ask

What is a Unix timestamp?

It is the number of seconds elapsed since 1970-01-01 00:00:00 UTC. Some systems use milliseconds instead of seconds.

How does the tool detect seconds or milliseconds?

Values with 13 or more digits are treated as milliseconds. Shorter numeric values are treated as seconds.

Why do local time and UTC time differ?

Unix timestamps are timezone independent, but human-readable dates are displayed in either your local timezone or UTC.

Related tools

Continue working