Timestamp Converter

Epoch & Unix Timestamp Conversion Utilities

The current Unix epoch time isLoading...
Loading...

Convert Date Format into a Readable Timestamp

Convert Logs with Timestamps

Paste logs to convert timestamps into readable dates.

SpreadSheet Converter

ABC
1
2
3
4

Converted Data (Read-Only)

ABC
1
2
3
4

Timestamps are automatically converted below.

What is Epoch?

The Epoch time is the current time measured in the number of seconds since the Unix Epoch. Epoch 0 is January 1, 1970, 00:00:00 GMT (ISO 8601: 1970-01-01T00:00:00Z). Leap seconds are not used in Unix time.

Normal TimeSeconds
1 minute60 seconds
1 hour3600 seconds
1 day86400 seconds
1 week604800 seconds
1 month (30.44 days)2629743 seconds
1 year (365.24 days)31556926 seconds

Programming with Epoch

The Unix Epoch time can be retrieved in various programming languages using built-in functions. Below is a reference for obtaining the current Unix timestamp in different environments.

LanguageCommandDocumentation
Bash (Linux/Unix)date +%sman date
Ctime(NULL)C Reference
C#(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSecondsC# Docs
C++std::time(nullptr)C++ Reference
ClickHouseSELECT toUnixTimestamp(now());ClickHouse Docs
Dart (Flutter)DateTime.now().millisecondsSinceEpoch ~/ 1000Dart Docs
Firebase FirestoreTimestamp.now().secondsFirestore Docs
Gotime.Now().Unix()Go Docs
Haskellimport Data.Time.Clock.POSIX; getPOSIXTimeHaskell Docs
Luaos.time()Lua Docs
Pythonimport time; time.time()Python Docs
Ras.numeric(Sys.time())R Docs
RustSystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs()Rust Docs
SwiftDate().timeIntervalSince1970Swift Docs
TypeScriptMath.floor(Date.now() / 1000)TypeScript Docs

Convert from Epoch to Human-Readable Date

Convert an Epoch timestamp into a human-readable date using various programming languages. The examples below all show how to convert the epoch timestamp `1698402600` (which represents 2023-10-27 10:30:00 UTC).

LanguageCode ExampleDocumentation
Bash (Linux/Unix)date -d @1698402600man date
CUse localtime() to convert to struct tm, then strftime() to format.C Reference (localtime, strftime)
C#DateTimeOffset.FromUnixTimeSeconds(1698402600).UtcDateTime.ToString()C# Docs (DateTimeOffset.FromUnixTimeSeconds)
C++Use std::localtime() to convert to std::tm, then std::strftime() to format.C++ Reference (localtime, strftime)
ClickHouseSELECT toDateTime(1698402600)ClickHouse Docs
Dart (Flutter)DateTime.fromMillisecondsSinceEpoch(1698402600 * 1000, isUtc: true)Dart Docs
Gotime.Unix(1698402600, 0).UTC()Go Docs (time.Unix)
JavaInstant.ofEpochSecond(1698402600).atZone(ZoneOffset.UTC)Java Docs (Instant.ofEpochSecond)
JavaScriptnew Date(1698402600 * 1000)MDN Web Docs (Date)
Luaos.date("%Y-%m-%d %H:%M:%S", 1698402600)Lua Docs (os.date)
PHPdate('Y-m-d H:i:s', 1698402600)PHP Docs (date)
Pythondatetime.datetime.utcfromtimestamp(1698402600)Python Docs (datetime.utcfromtimestamp)
Ras.POSIXct(1698402600, origin='1970-01-01', tz='UTC')R Docs (as.POSIXct)
RubyTime.at(1698402600).utcRuby Docs (Time.at)
Rust Use the chrono crate: NaiveDateTime::from_timestamp_opt().Rust Docs (chrono::NaiveDateTime)
SwiftDate(timeIntervalSince1970: 1698402600)Swift Docs (Date)
TypeScriptnew Date(1698402600 * 1000)TypeScript/JavaScript Docs (Date)