Unix Timestamp to Date Converter — Free Tool

The term unix timestamp is the standard column name you see in database schemas, application logs, and API payloads. PostgreSQL tables store event times in a unix_timestamp column, MySQL schemas use the same convention, and cron schedulers write job execution records with a raw integer field that database engineers universally call the unix timestamp. JWT tokens embed expiry and issue times in the exp and iat fields — both stored as unix timestamps in seconds. Converting that integer back to a human date is a daily task for backend developers and data analysts. In Python, use datetime.fromtimestamp(ts); in JavaScript, use new Date(ts * 1000); on the Bash command line, run date -d @ts. Use the tool below to decode any unix timestamp instantly.

Input

Result

Enter a Unix timestamp to see the date and time.

Unix Timestamp to Date — Code Examples

Python

from datetime import datetime, timezone

ts = 1700000000

# Local time
dt_local = datetime.fromtimestamp(ts)
print(dt_local)  # e.g. 2023-11-14 23:13:20 (depends on system timezone)

# UTC
dt_utc = datetime.fromtimestamp(ts, tz=timezone.utc)
print(dt_utc)    # 2023-11-14 22:13:20+00:00

JavaScript

const ts = 1700000000;

// ISO 8601 string (UTC)
const iso = new Date(ts * 1000).toISOString();
console.log(iso); // "2023-11-14T22:13:20.000Z"

// Locale string (browser local timezone)
const local = new Date(ts * 1000).toLocaleString();
console.log(local); // "11/14/2023, 10:13:20 PM" (varies by locale)

Bash

# GNU/Linux
date -d @1700000000
# Tue Nov 14 22:13:20 UTC 2023

# BSD/macOS
date -r 1700000000
# Tue Nov 14 22:13:20 UTC 2023

PostgreSQL

-- Convert literal value
SELECT to_timestamp(1700000000);
-- Result: 2023-11-14 22:13:20+00

-- Convert with explicit UTC
SELECT to_timestamp(1700000000) AT TIME ZONE 'UTC';
-- Result: 2023-11-14 22:13:20

MySQL

-- Returns DATETIME
SELECT FROM_UNIXTIME(1700000000);
-- Result: 2023-11-14 22:13:20

-- Extract date only
SELECT DATE(FROM_UNIXTIME(1700000000));
-- Result: 2023-11-14

Frequently Asked Questions

How do I convert a Unix timestamp to a date in PostgreSQL?+

Use the to_timestamp() function: SELECT to_timestamp(1700000000); returns a timestamptz value. For a table column named unix_timestamp, write SELECT to_timestamp(unix_timestamp) FROM your_table;. To display the result in UTC explicitly, append AT TIME ZONE 'UTC': SELECT to_timestamp(1700000000) AT TIME ZONE 'UTC';

How do I convert a Unix timestamp to a date in MySQL?+

Use FROM_UNIXTIME(): SELECT FROM_UNIXTIME(1700000000); returns a DATETIME value such as '2023-11-14 22:13:20'. To extract only the date part, wrap it with DATE(): SELECT DATE(FROM_UNIXTIME(unix_timestamp)) FROM your_table;. The function accepts a column reference directly, so you can use it inside WHERE, ORDER BY, and GROUP BY clauses.

Is there an Excel formula to convert Unix timestamp to date?+

Yes. Assuming the unix timestamp (in seconds) is in cell A1, enter =A1/86400+25569 in another cell and format it as a Date or Date-Time. The constant 25569 is the number of days between 1900-01-01 (Excel's epoch) and 1970-01-01 (Unix epoch). For millisecond timestamps divide by 86400000 instead: =A1/86400000+25569.

How do I convert a Unix timestamp in Google Sheets?+

Use the formula =(A1/86400)+DATE(1970,1,1) where A1 holds the Unix timestamp in seconds. After entering the formula, format the cell as Date-Time via Format > Number > Date time. For milliseconds use =(A1/86400000)+DATE(1970,1,1).

How do I convert a Unix timestamp in .NET?+

Use DateTimeOffset.FromUnixTimeSeconds(ts).UtcDateTime for second-precision timestamps, or DateTimeOffset.FromUnixTimeMilliseconds(ts).UtcDateTime for millisecond-precision ones. Both methods are available since .NET Standard 1.3 / .NET Framework 4.6. The result is a DateTime in UTC; call .ToLocalTime() if you need the local timezone.

Related Tools

Related Tools