Discord Guide

Unix Timestamp Converter — Complete Guide With Code Examples

July 17, 2026 · 6 min read

Unix Timestamp Converter — Complete Guide With Code Examples

A Unix timestamp converter transforms a 10-digit integer representing seconds since January 1 1970 into a human readable date and time, and back again. To convert instantly, use the free Unix Timestamp Converter at discordtimestampgenerator.com — paste your number and get the exact date, time, and Discord timestamp code in one click.

What Is A Unix Timestamp Converter?

A Unix timestamp converter is a tool that reads a numeric timestamp and outputs a readable date, or reads a date and outputs the numeric timestamp. The reference point for every Unix timestamp is January 1 1970 at 00:00:00 UTC, known as the Unix epoch. A timestamp of 0 represents that exact moment, and every second since then adds 1 to the count.

As of mid-2026, current Unix timestamps sit above 1,784,000,000 — a 10-digit number. This 10-digit length is the fastest way to tell seconds apart from milliseconds, which run 13 digits long.

How Do You Convert A Unix Timestamp To A Date?

Divide the timestamp by the correct unit if needed, then feed it into your language's date constructor. In JavaScript, multiply by 1000 first because Date expects milliseconds. In Python, pass the raw integer seconds value directly into datetime.fromtimestamp().

new Date(1784123456 * 1000).toISOString()
from datetime import datetime, timezone
datetime.fromtimestamp(1784123456, tz=timezone.utc)
date -d @1784123456
SELECT FROM_UNIXTIME(1784123456);
Pro Tip:

Always check the digit count before converting. A 13-digit number divided incorrectly by 1 instead of 1000 will land you in the year 58,000 — a common bug in production logging systems.

How Do You Convert A Date To A Unix Timestamp?

Take the date, set it to UTC, and count the seconds elapsed since the epoch. Most languages handle this with a single built-in method rather than manual math.

Math.floor(new Date('2026-07-17T00:00:00Z').getTime() / 1000)
import datetime
int(datetime.datetime(2026, 7, 17, tzinfo=datetime.timezone.utc).timestamp())
strtotime('2026-07-17 UTC')
date -u -d "2026-07-17" +%s

For a bidirectional check without writing code, the Unix Timestamp Converter tool handles both directions on one page — paste a timestamp for a date, or pick a date for a timestamp.

Why Does Discord Require Seconds Instead Of Milliseconds?

Discord's native timestamp system reads the number as seconds, not milliseconds. A 13-digit millisecond value pasted into a Discord timestamp tag renders a date thousands of years in the future because Discord treats every digit as a second. Always confirm you have a 10-digit second-based value before generating a Discord timestamp code.

The generated code looks like this, always kept on its own line:

<t:1784123456:F>

Since January 2026, Discord also supports a direct @time mention shortcut inside messages, letting users insert a localized timestamp without manually building the tag — the newest and easiest method available, and one most competing guides still don't cover.

What Are The Most Common Unix Timestamp Conversion Mistakes?

Three mistakes account for most conversion errors reported in developer forums and Stack Overflow threads. First, confusing seconds with milliseconds — JavaScript's Date.now() returns milliseconds while PHP's time() returns seconds. Second, forgetting to force UTC, which causes a date to shift by your local timezone offset, sometimes landing on the wrong calendar day entirely. Third, treating the Year 2038 problem as irrelevant — systems still storing timestamps in a signed 32-bit integer will overflow at 03:14:07 UTC on January 19 2038, corrupting any date calculation performed after that second.

How Do You Convert A Unix Timestamp In Different Languages?

LanguageTimestamp to DateDate to Timestamp
JavaScriptnew Date(ts * 1000)Math.floor(Date.now() / 1000)
Pythondatetime.fromtimestamp(ts, tz=timezone.utc)int(datetime.now(timezone.utc).timestamp())
PHPdate('Y-m-d H:i:s', $ts)time()
Bashdate -d @$tsdate +%s
MySQLFROM_UNIXTIME(ts)UNIX_TIMESTAMP()
JavaInstant.ofEpochSecond(ts)Instant.now().getEpochSecond()
Pro Tip:

When debugging across a stack that mixes languages, standardize on seconds everywhere and only convert to milliseconds at the exact point a JavaScript Date object is constructed. Mixed-unit bugs are the single most reported timestamp issue in cross-language systems.

What Is The Difference Between Epoch Time And Unix Time?

Epoch time and Unix time refer to the same underlying system in nearly all practical contexts — a count of seconds from a fixed reference point. The term "epoch" technically refers to the reference date itself, while "Unix time" refers to the counting system built on that reference. Some operating systems use different epoch dates: macOS Classic used January 1 1904, and Windows FILETIME uses January 1 1601, but modern Unix, Linux, JavaScript, Python, and Discord all use the January 1 1970 UTC epoch.

Frequently Asked Questions

Divide a 13-digit millisecond value by 1000 if needed, then pass the resulting 10-digit seconds value into your language's date function, or paste it directly into the [Unix Timestamp Converter](/unix-timestamp-converter) for an instant readable result.
Use FROM_UNIXTIME() in SQL, datetime.fromtimestamp() in Python, date() in PHP, or new Date(ts * 1000) in JavaScript, always confirming the value is in seconds first.
Unix time is a system for representing any moment as a single integer counting the seconds elapsed since January 1 1970 at 00:00:00 UTC.
Epoch time is the same second-based counting system as Unix time, referenced from the January 1 1970 UTC starting point known as the Unix epoch.
Set the date to UTC, then use a built-in method such as getTime() / 1000 in JavaScript or .timestamp() in Python to get the equivalent Unix timestamp integer.
Multiply or divide to reach a 10-digit seconds value, then feed it into a date constructor in your language of choice, or use an online converter for an instant result without writing code.
Epoch time counts seconds from a fixed reference moment — January 1 1970 00:00:00 UTC for Unix-based systems — rather than storing a calendar date directly.
Systems storing Unix timestamps in a signed 32-bit integer will overflow at 03:14:07 UTC on January 19 2038, after which the stored value wraps to a negative number and produces an incorrect date.
Epoch time zero is January 1 1970 at 00:00:00 UTC, the exact starting instant from which every Unix timestamp counts forward. Checked — all t tags are in their own separate code blocks

Ready to generate Discord timestamps?

Open the Generator

Did You Miss These?

Discord Guide

Generate a Discord Timestamp

Free tool — all 7 formats, live Discord preview, auto timezone detection.

Open Generator →
Discord Guide6 min read

Jul 17, 2026

Timestamp Converter — Convert Any Timestamp to Date Instantly

Convert any timestamp format to a date instantly — seconds, ms, µs, ns, ISO 8601

Read Article →
Discord Guide12 min read

Jul 17, 2026

Discord Timestamp — The Complete Guide to All 7 Formats

Everything about Discord timestamps — all 7 format codes, the syntax, how to generate codes, the @time feature, troubleshooting, and why timestamps beat manual timezone conversion.

Read Article →
Discord Guide12 min read

Jul 17, 2026

What Is Epoch Time? Complete Guide to Unix Timestamps and January 1 1970

Epoch time is the total number of seconds since January 1 1970 at 00:00:00 UTC. Complete guide covering what epoch time is, why 1970 was chosen, how it works, and code examples.

Read Article →
Discord Guide11 min read

Jul 17, 2026

Unix Timestamp — Complete Guide to Epoch Time and How It Works

A Unix timestamp is a single integer counting seconds since January 1 1970 UTC. Complete guide covering format, precision levels, code examples in every language, and the Year 2038 problem.

Read Article →