Discord timestamp generator
Pick a date and time; copy the code. Discord shows it to everyone in their own time zone and language.
| Code | Shows (in your language) | Copy |
|---|
Unix time:
Paste an ID: in Discord, turn on Developer Mode, then right-click a user, message or server and choose Copy ID.
How Discord timestamps work
Put <t:1800000000:R> in a message and Discord shows it in each reader's own time zone and language: that one says "3:00 AM" to a reader in New York and "09:00" to one in Berlin. The number is Unix time, seconds since 1 January 1970 in UTC; the letter after the second colon picks the style. Leave the letter out and you get f.
Timestamps work in message text, and in embed descriptions and field values. In an embed's title, author or footer they show as the plain code.
The nine styles
For 1800000000, which is 15 January 2027 at 08:00 UTC, as a reader in UTC with Discord in US English sees it:
| Code | Style | Shows |
|---|---|---|
<t:1800000000:t> | Short time | 8:00 AM |
<t:1800000000:T> | Time with seconds | 8:00:00 AM |
<t:1800000000:d> | Short date | 01/15/2027 |
<t:1800000000:D> | Long date | January 15, 2027 |
<t:1800000000:f> | Date and time (the default) | January 15, 2027 at 8:00 AM |
<t:1800000000:F> | Day, date and time | Friday, January 15, 2027 at 8:00 AM |
<t:1800000000:s> | Short date and time | 01/15/2027, 8:00 AM |
<t:1800000000:S> | Short date, time with seconds | 01/15/2027, 8:00:00 AM |
<t:1800000000:R> | Relative | in 3 months, or 2 hours ago |
s and S are the newest two; older guides list seven. R keeps counting: "in 5 minutes" becomes "5 minutes ago" without anyone editing the message.
Making one in your bot
discord.py has discord.utils.format_dt, which takes a timezone-aware datetime:
import datetime as dt
import discord
when = dt.datetime.now(dt.timezone.utc) + dt.timedelta(hours=2)
await interaction.response.send_message(f"Starts {discord.utils.format_dt(when, style='R')}")
# Starts <t:1800007200:R>
discord.js has time and TimestampStyles:
const { time, TimestampStyles } = require("discord.js");
const when = new Date(Date.now() + 2 * 60 * 60 * 1000);
await interaction.reply(`Starts ${time(when, TimestampStyles.RelativeTime)}`);
Without a library: int(when.timestamp()) in Python, Math.floor(when.getTime() / 1000) in JavaScript, then <t:NUMBER:R>. Use seconds: a JavaScript millisecond value shows a date thousands of years away.
IDs carry their own date
Every Discord ID (a snowflake) starts with the moment it was made: shift the ID right by 22 bits and add 1420070400000, the first millisecond of 2015, and you have the time in milliseconds. That is how a bot can tell how old an account or a message is without asking Discord. discord.py has discord.utils.snowflake_time(id); discord.js has SnowflakeUtil.timestampFrom(id).