Unix timestamp converter.

Convert an epoch timestamp to a human date, or a date to a timestamp. Seconds, milliseconds, microseconds and nanoseconds are detected automatically. Nothing leaves your browser.

Current Unix time...seconds
Milliseconds...what Date.now() returns
UTC...ISO 8601

About this tool

Unix time counts seconds since 00:00:00 UTC on 1 January 1970, ignoring leap seconds. Most systems log it in seconds; JavaScript, Java and many databases use milliseconds; some tracing and database systems use microseconds or nanoseconds. Paste any of them: the number of digits decides the unit (up to 10 is seconds, 13 is milliseconds, 16 is microseconds, 19 is nanoseconds) and the detected unit is shown in the output. Type a date on the right to go the other way. Link straight to a value with /tools/epoch?t=1700000000.

What you get back

RowMeaning
Seconds, milliseconds, microseconds, nanosecondsThe same instant in each unit, ready to paste into whatever expects it.
ISO 86012023-11-14T22:13:20.000Z. The format to use in APIs and logs; unambiguous and sortable.
RFC 1123 (UTC)The HTTP date format used in Date, Expires and Last-Modified headers.
LocalThe instant in your browser's time zone, with the zone name and UTC offset.
RelativeHow long ago or how far ahead. The fastest sanity check on a token expiry or a log line.
Day of year, ISO weekFor cron schedules and reports.

Get the current Unix timestamp in code

LanguageSecondsMilliseconds
Gotime.Now().Unix()time.Now().UnixMilli()
JavaScriptMath.floor(Date.now() / 1000)Date.now()
Pythonint(time.time())int(time.time() * 1000)
PHPtime()(int) (microtime(true) * 1000)
JavaInstant.now().getEpochSecond()System.currentTimeMillis()
RustSystemTime::now().duration_since(UNIX_EPOCH)?.as_secs().as_millis()
C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()
RubyTime.now.to_i(Time.now.to_f * 1000).to_i
Shelldate +%sdate +%s%3N (GNU)
PostgreSQLextract(epoch from now())::bigint(extract(epoch from now()) * 1000)::bigint
MySQLUNIX_TIMESTAMP()ROUND(UNIX_TIMESTAMP(NOW(3)) * 1000)
SQLitestrftime('%s','now')(julianday('now') - 2440587.5) * 86400000

Convert a timestamp to a date in code

LanguageFrom seconds
Gotime.Unix(1700000000, 0).UTC()
JavaScriptnew Date(1700000000 * 1000).toISOString()
Pythondatetime.fromtimestamp(1700000000, tz=timezone.utc)
PHPgmdate('c', 1700000000)
JavaInstant.ofEpochSecond(1700000000)
Shelldate -u -d @1700000000 (GNU) · date -u -r 1700000000 (macOS)
PostgreSQLto_timestamp(1700000000)
MySQLFROM_UNIXTIME(1700000000)

Things that go wrong with timestamps