WorldClockDiff

Unix timestamp converter

Paste a Unix timestamp or ISO 8601 date into Developer tools, or click any hour to get its epoch value in every zone.

Night Morning / evening Working hours Everyone at work · drag the highlighted column or click an hour

Convert a time

    Developer tools

    Get and convert Unix time in code

    LanguageCurrent timestampTimestamp to date
    JavaScriptMath.floor(Date.now() / 1000)new Date(ts * 1000).toISOString()
    Pythonint(time.time())datetime.fromtimestamp(ts, tz=timezone.utc)
    JavaInstant.now().getEpochSecond()Instant.ofEpochSecond(ts)
    Gotime.Now().Unix()time.Unix(ts, 0).UTC()
    C#DateTimeOffset.UtcNow.ToUnixTimeSeconds()DateTimeOffset.FromUnixTimeSeconds(ts)
    PHPtime()date('c', $ts)
    PostgreSQLEXTRACT(EPOCH FROM now())to_timestamp(ts)
    MySQLUNIX_TIMESTAMP()FROM_UNIXTIME(ts)
    Bashdate +%sdate -u -d @ts # macOS: date -u -r ts

    Frequently asked questions

    What is a Unix timestamp?

    A Unix timestamp (epoch time) is the number of seconds since 1 January 1970 00:00:00 UTC, not counting leap seconds. It is the same everywhere in the world, so it is ideal for storing and comparing times.

    Is my timestamp in seconds or milliseconds?

    Timestamps with 10 digits are seconds; 13 digits are milliseconds (JavaScript Date.now()). This converter detects both automatically.

    What is the year 2038 problem?

    Systems that store Unix time as a signed 32-bit integer overflow on 19 January 2038 at 03:14:07 UTC. Use 64-bit integers to avoid it.

    Should I store times in UTC?

    Yes. Store instants as UTC (or Unix time) and keep the user's IANA time zone, such as America/New_York, separately. Convert to local time only for display so daylight saving changes are always correct.