Guide • discord.js • discord.py
Discord Timestamps in Bots, Embeds & Events
By the DiscordTimestamps.org team · Updated
Send times your whole server can read. Bots use the same <t:UNIX:STYLE> codes as people do,
and these examples build them for you.
The format bots send
A Discord timestamp is plain text: <t:, the unix time in seconds, an optional
style letter, and >. Discord's client does the formatting, so your bot never has to know a
member's time zone. Discord currently documents 9 style letters: t, T, d,
D, f (default), F, s, S and R.
s and S are the newest, so check that your library's helper offers them, or build the
string yourself as shown below. The formats table shows what each one looks like.
Need a one-off code for testing? Make it in the Discord timestamp generator.
discord.js
discord.js exports a time() helper and a TimestampStyles enum. Pass a Date
or a unix time in seconds.
import { time, TimestampStyles } from "discord.js";
const start = new Date("2026-12-04T20:00:00-05:00");
await interaction.reply(
`Game night starts ${time(start, TimestampStyles.LongDateTime)} ` +
`(${time(start, TimestampStyles.RelativeTime)})`
);
// → Game night starts <t:1796432400:F> (<t:1796432400:R>) Timestamps inside an embed
Put codes in the description or field values. Titles, authors and footers don't render them.
import { EmbedBuilder, time } from "discord.js";
const unix = Math.floor(start.getTime() / 1000);
const embed = new EmbedBuilder()
.setTitle("Community raid") // no timestamps here
.setDescription(`Starts <t:${unix}:F>`) // ✓ renders
.addFields({ name: "Countdown", value: `<t:${unix}:R>` }) // ✓ renders
.setTimestamp(start); // footer time, ISO date discord.py
discord.utils.format_dt() takes a timezone-aware datetime and a style letter. Use an
aware datetime: a naive one is read as the server's local time.
import discord
from datetime import datetime, timezone
start = datetime(2026, 12, 5, 1, 0, tzinfo=timezone.utc)
await ctx.send(
f"Game night starts {discord.utils.format_dt(start, 'F')} "
f"({discord.utils.format_dt(start, 'R')})"
)
# → Game night starts <t:1796432400:F> (<t:1796432400:R>) Any language
Without a library helper, build the string yourself. Remember: seconds, not milliseconds.
// JavaScript / TypeScript
const tag = (date, style = "f") => `<t:${Math.floor(date.getTime() / 1000)}:${style}>`;
# Python
def tag(dt, style="f"):
return f"<t:{int(dt.timestamp())}:{style}>" Event announcements that work worldwide
- Create the scheduled event in Discord with its own date picker. Members already see that start time in their zone.
- Post the announcement with
<t:UNIX:F> (<t:UNIX:R>)so it shows the full date and a live countdown. - Planning by another region's clock? Pick that time zone in the Discord time converter before copying the code.
- For reminders, have your bot post
<t:UNIX:R>again an hour before the start.
Bots & embeds FAQ
Where do timestamps render inside a Discord embed?
In the embed description and in field values. Titles, author names and footers show the raw <t:…> code. The embed's own timestamp property is separate: it takes an ISO 8601 date and is shown next to the footer.
Should a bot send seconds or milliseconds?
Seconds. Discord's <t:…> format expects unix seconds. In JavaScript use Math.floor(date.getTime() / 1000); in Python use int(dt.timestamp()).
Do timestamps work in slash command replies and webhooks?
Yes. Interaction replies, follow-ups and webhook messages use the same message content and embed rules, so <t:…> codes render wherever normal message markdown does.
Can I use a timestamp in a Discord scheduled event?
The start time of a scheduled event is set with Discord's own date picker and already shows in each member's time zone. Use timestamps in the announcement message that promotes the event, where a countdown with <t:UNIX:R> works well.