Convert Unix epoch time to a human-readable date and back, in any unit. This tool auto-detects whether your timestamp is in seconds, milliseconds, microseconds, or nanoseconds based on its magnitude, then shows the moment in four formats: UTC, ISO 8601, your local time, and a relative description like "3 hours ago". The reverse direction is also supported - pick any datetime and get the Unix timestamp in the unit you need.
A Unix timestamp (also called Unix time, epoch time, or POSIX time) is the number of seconds that have elapsed since 00:00:00 UTC on 1 January 1970, excluding leap seconds. It is the single most common way to represent a moment in time in databases, logs, APIs, and distributed systems because it is timezone-agnostic, sorts correctly as an integer, and is language-independent. Every major programming language and database has first-class support for it.
Unix time was originally defined in seconds (10 digits through year 2286), but many modern systems need more precision:
Date.now()), Java (System.currentTimeMillis()), Kafka, most logging systems.TIMESTAMP internal precision), Python datetime.TIMESTAMP_NTZ internal precision, Go time.UnixNano(), high-frequency trading logs.This tool auto-detects the unit from your number's magnitude (a 10-digit number is seconds, a 13-digit number is milliseconds, etc.), but you can force a unit via the dropdown if you know the source is different.
Every warehouse has built-in conversion functions, but the syntax differs:
TO_TIMESTAMP_NTZ(epoch_s) for seconds; TO_TIMESTAMP_NTZ(epoch_ms, 3) for milliseconds (the second argument is the scale). Reverse: DATE_PART(EPOCH_SECOND, ts).TO_TIMESTAMP(epoch_s); reverse: EXTRACT(EPOCH FROM ts). For milliseconds divide by 1000 first.TIMESTAMP_SECONDS(), TIMESTAMP_MILLIS(), TIMESTAMP_MICROS(). Reverse: UNIX_SECONDS(ts), UNIX_MILLIS(ts).FROM_UNIXTIME(epoch_s) and UNIX_TIMESTAMP(ts). Milliseconds need manual math.TIMESTAMP 'epoch' + epoch_s * INTERVAL '1 second'. Verbose but portable.from_unixtime(epoch_s) and unix_timestamp(ts).Systems that store Unix time as a signed 32-bit integer can only represent times up to 2^31 - 1 seconds past the epoch, which is 03:14:07 UTC on 19 January 2038. After that, the counter overflows to a negative number (December 1901). Most modern systems now use 64-bit timestamps and are unaffected, but legacy embedded systems, older databases, and poorly-written ETL code can still be vulnerable. Always check your data warehouse column types - a Snowflake INTEGER is 38-digit fixed-point and safe, but a source system might export epochs as 32-bit INT.
Working with scheduled jobs? Use the Cron Expression Builder to model when your next run fires. Need to pretty-print SQL that uses epoch functions? The SQL Formatter handles multi-dialect output. For time-series cost estimation see the Snowflake Cost Calculator, and for timestamp function reference see the Snowflake SQL cheat sheet.
← Back to Home