Discord Timestamp Syntax & Formatting Guide
A technical reference manual for server managers and bot developers. Master markdown tag structure, all 9 format flags, DST timezone rules, and programmatic bot integration.
Quick Syntax Overview & Tag Rules
Step 1: Calculate the Unix timestamp. Convert your event date and timezone to a Unix epoch integer (seconds since 1 Jan 1970 UTC).
Step 2: Append the format flag. Wrap the number in Discord's tag syntax: <t:UNIX_SECONDS:FLAG>.
Step 3: Paste into Discord chat. Paste the tag into any Discord message box and press Enter. Discord renders it immediately for every viewer in their own local timezone.
Use our interactive converter with automatic timezone detection and live previews.
The Anatomy of a Discord Timestamp
f.Discord Timestamp Format Flags Reference
Discord supports 9 format styles to control how dates and times display in chat.
| Flag | Format Name | View | Timestamp |
|---|---|---|---|
| :t | Short Time | 9:01 AM | <t:1795856460:t> |
| :T | Long Time (with seconds) | 9:01:00 AM | <t:1795856460:T> |
| :d | Short Date | 11/28/2026 | <t:1795856460:d> |
| :D | Long Date | November 28, 2026 | <t:1795856460:D> |
| :f | Short Date/Time | November 28, 2026 9:01 AM | <t:1795856460:f> |
| :F | Full Date/Time | Saturday, November 28, 2026 9:01 AM | <t:1795856460:F> |
| :s | Short Date/Time | 11/28/2026 9:01 AM | <t:1795856460:s> |
| :S | Long Date/Time | 11/28/2026 9:01:00 AM | <t:1795856460:S> |
| :R | Relative Time | in 2 hours / 3 days ago | <t:1795856460:R> |
Why Fixed Abbreviations Cause 1-Hour Errors
The most common complaint when scheduling Discord events is: "My announcement was scheduled for 8 PM, but members saw 7 PM or 9 PM!"
This error happens because people often use static acronyms like EST or PST. During Daylight Saving Time, these regions switch to EDT and PDT. If you convert against "EST" in July, you are off by exactly 1 hour.
Using Timestamps in Discord.js & Discord.py
import { time, TimestampStyles } from 'discord.js';
const eventDate = new Date('2026-11-28T18:00:00Z');
// Using discord.js time helper:
const relative = time(eventDate, TimestampStyles.RelativeTime);
// Or standard template literal:
const epochSec = Math.floor(eventDate.getTime() / 1000);
const msg = `Event begins in <t:${epochSec}:R>!`;from datetime import datetime, timezone
import discord
from discord.utils import format_dt
dt = datetime(2026, 11, 28, 18, 0, tzinfo=timezone.utc)
# Using format_dt helper:
relative_str = format_dt(dt, style='R')
# Or raw Unix integer:
epoch = int(dt.timestamp())
await ctx.send(f"Event starts <t:{epoch}:R>!")Discord Timestamp Syntax & Developer FAQ
Technical answers to regex matching, embed limitations, Discord.js and Discord.py implementation rules, and @invalid-date troubleshooting.
What is the regex pattern to match Discord timestamps?
To match Discord timestamp markdown tags in text, use the regular expression: <t:(\d+)(:[tTdDfFsSR])?>. This regex extracts both the 10-digit Unix timestamp and the optional style flag.
Why doesn't a timestamp convert inside Discord embed titles or footers?
Discord's client markdown parser only converts timestamp tags inside embed descriptions and embed field values. Embed titles and embed footers display raw characters without markdown translation. Always place dynamic timestamps inside the description or fields.
How do I format timestamps in Discord.js v14?
In Discord.js v14, use the built-in time() helper and TimestampStyles enum: time(new Date(), TimestampStyles.RelativeTime). Alternatively, compute epoch seconds directly with Math.floor(Date.now() / 1000) and format the string as <t:${epoch}:R>.
How do I format timestamps in Discord.py?
In Discord.py, import format_dt from discord.utils: discord.utils.format_dt(datetime_obj, style='R'). This automatically formats the datetime object into a compliant Discord tag.
Why does Discord display @invalid-date in chat?
Discord displays @invalid-date when the timestamp number is non-numeric, out of range, or passed as a 13-digit millisecond value instead of 10-digit seconds. Ensure your code passes integer seconds (such as 1726257000).