Unix Timestamp Converter

Convert Unix timestamps to human-readable dates and vice versa. Supports seconds and milliseconds.

Current Unix Timestamp

Timestamp → Date

Date → Timestamp

What is a Unix Timestamp?

A Unix timestamp is the number of seconds since January 1, 1970 00:00:00 UTC (the Unix Epoch). It's used in programming, databases, and APIs to represent dates in a timezone-independent format.

Video Tutorial

2:15

Video coming soon — full transcript available below

Chapters

Full transcript searchable
0:00

What Unix timestamps are and where you encounter them

Welcome to this Unix Timestamp Converter tutorial. A Unix timestamp (also called epoch time) is the number of seconds that have elapsed since January 1, 1970 at 00:00:00 UTC. It's the standard way to represent time in most programming languages and databases. You'll encounter Unix timestamps in: REST API responses (created_at fields), database records, server log files, JWT expiry claims, file system metadata, and analytics events. The problem is that a timestamp like 1709251200 is meaningless to humans without conversion.

0:28

Convert timestamp to human-readable date

Open the Timestamp Converter on ToolPilot.dev. In the Unix timestamp input, paste the timestamp you want to convert. Click Convert. The tool shows the corresponding date and time in both UTC and your local timezone. For example, 1709251200 converts to 2024-03-01 00:00:00 UTC. You can also convert millisecond timestamps — those 13-digit numbers from JavaScript's Date.now() — by enabling the milliseconds toggle.

0:55

Convert date to Unix timestamp

To go the other direction, use the date-to-timestamp converter. Enter a date and time in the date picker or type it in ISO format — YYYY-MM-DD HH:MM:SS. Specify the timezone if needed. Click Convert and the Unix timestamp appears. This is useful when building API queries that accept timestamp parameters, generating test data with specific dates, or comparing dates across systems.

1:25

Current timestamp button

The 'Get Current Timestamp' button instantly shows the current Unix timestamp. This is useful when you need the current time in epoch format for API calls, when debugging time-sensitive code, or when you need to set an expiry time by adding seconds to the current timestamp. The display updates every second when enabled, showing the live current epoch time.

1:50

Debugging API responses and JWT tokens

The most common use case is debugging: you receive an API response with an exp field of 1709337600 and need to know if the token is expired. Paste it here and instantly see the expiry date. Similarly, when a cron job runs at a specific timestamp or a database record shows an updated_at timestamp, converting it tells you the exact date and time it occurred. This eliminates mental math and timestamp calculation errors.

2:05

Wrap-up

The Unix Timestamp Converter on ToolPilot.dev handles conversion in both directions for seconds and milliseconds, with UTC and local timezone display. All conversion happens in your browser using JavaScript's Date object. No server involved, works offline, and handles dates from 1970 through 2038 and beyond. Visit ToolPilot.dev for this and 19 other free developer tools.

Transcript covers all 6 chapters (2:15 total).

Frequently Asked Questions

What is a Unix timestamp?
A Unix timestamp is the number of seconds (or milliseconds) elapsed since January 1, 1970 00:00:00 UTC — known as the Unix epoch. It is a universal, timezone-independent way to represent a point in time.
How do I convert a Unix timestamp to a human-readable date?
Paste your Unix timestamp (e.g., 1709942400) into the Unix Timestamp Converter and click Convert. The tool displays the equivalent date and time in UTC and your local timezone.
What is the difference between seconds and milliseconds timestamps?
Unix timestamps in seconds are 10 digits (e.g., 1709942400). Timestamps in milliseconds are 13 digits (e.g., 1709942400000). JavaScript's Date.now() returns milliseconds; most Unix systems use seconds.
How do I get the current Unix timestamp?
In JavaScript: Math.floor(Date.now() / 1000) for seconds, or Date.now() for milliseconds. In Python: import time; int(time.time()). In bash: date +%s.
What is the Unix epoch?
The Unix epoch is January 1, 1970, 00:00:00 UTC — the reference point from which all Unix timestamps are measured. A timestamp of 0 equals this exact moment.
What is the Year 2038 problem?
The Year 2038 problem occurs because many 32-bit systems store Unix timestamps as signed integers, which overflow on January 19, 2038. Modern 64-bit systems are not affected and can represent dates far into the future.
How do I convert a date to a Unix timestamp?
Enter a human-readable date (e.g., 2024-03-15 12:00:00) into the Timestamp Converter's date field and click Convert to get the equivalent Unix timestamp in seconds and milliseconds.
Are Unix timestamps timezone-aware?
Unix timestamps always represent UTC. The converter shows you the timestamp in UTC and automatically converts to your local timezone for readability.
How do I use timestamps in API requests?
Many APIs (GitHub, Stripe, AWS) accept or return Unix timestamps. Use the converter to translate API timestamp values to readable dates for debugging, or convert human-readable dates to timestamps for API query parameters.

Code Examples

Ready-to-use implementations in popular programming languages. Copy, paste, and run.

Convert Timestamps in JavaScript
// Get current Unix timestamp (seconds)
const timestamp = Math.floor(Date.now() / 1000);
console.log(timestamp); // e.g. 1700000000

// Convert timestamp to readable date
const date = new Date(1700000000 * 1000);
console.log(date.toISOString());       // 2023-11-14T22:13:20.000Z
console.log(date.toLocaleString());     // locale-specific format

// Convert date string to timestamp
const ts = Math.floor(
  new Date('2024-01-15T10:30:00Z').getTime() / 1000);
console.log(ts); // 1705312200

Related Workflow Guides

Compare with alternatives