Using Discord Timestamps in Bots, Embeds & Webhooks

The <t:UNIX:FORMAT> markup isn't limited to messages you type by hand — the exact same syntax works from bot code, embed fields, and webhook payloads.

Same syntax, any source

Discord's client doesn't distinguish between a timestamp a person typed and one a bot generated — both are just text matching the <t:UNIX:FORMAT> pattern, and both render identically. That means anywhere your bot sends text — a reply, a scheduled announcement, an embed field, a webhook payload — you can drop in a correctly formatted timestamp and it will render live, in each reader's own timezone, with no extra work on Discord's end.

Generating the Unix seconds in code

You need the target moment as whole seconds since the Unix epoch. In JavaScript,Math.floor(Date.now() / 1000) gives you the current moment; for an arbitrary date, build aDate object first and divide its .getTime() (milliseconds) by 1000. In Python, int(time.time()) gives the current moment, or convert a datetime withint(dt.timestamp()). Whatever language your bot is written in, the underlying requirement is the same: whole seconds, not milliseconds — a common bug is pasting a millisecond timestamp directly, which produces a wildly wrong date. Seethe troubleshooting page for how to spot that mistake.

Testing before you wire it into code

If you're building a bot feature that posts timestamps and want to see the exact rendered output before writing the generation logic, use the generator embedded on this page (or thehomepage tool) to produce a real code for your target date, paste it into a test channel, and confirm it renders the way you expect — then replicate the same Unix-seconds calculation in your bot's code.

Timestamps inside embeds

Discord embeds have their own dedicated timestamp field (shown as a small date next to the footer), which is separate from putting <t:UNIX:FORMAT> markup inside an embed's description or a field's value. You can use either independently, or both together — the dedicated footer timestamp for "when this embed was generated," and inline timestamp markup within the body for something the embed is actually about, like an event start time.

Further reading

For the complete, community-maintained technical reference on Discord's timestamp syntax and edge cases, search for LeviSnoot's Discord Timestamp Syntax gist on GitHub — it's widely cited in the Discord developer community. See also theformat code reference on this site for a plain-language breakdown of all seven letters.

Try it now

Pick a date & time

Setting this time in

Format

Discord preview

you

 

Code to paste

All formats, this moment

CodeNameRenders asPaste this
tShort Time9:01 PM<t:…:t>
TLong Time9:01:00 PM<t:…:T>
dShort Date11/28/2018<t:…:d>
DLong DateNovember 28, 2018<t:…:D>
fShort Date/TimeNovember 28, 2018 9:01 PM<t:…:f>
FLong Date/TimeWednesday, November 28, 2018 9:01 PM<t:…:F>
RRelative Time3 years ago<t:…:R>

Frequently asked questions

How do I add a Unix timestamp in Discord programmatically?

Compute the current or target time as Unix seconds — in JavaScript, Math.floor(Date.now() / 1000); in Python, int(time.time()) — then format it into a string like <t:1735689600:F> and send that as your message content, embed field value, or webhook payload text. Discord's client renders it exactly the same way regardless of whether a human typed it or a bot sent it.

Is there a Discord timestamp command?

Discord itself doesn't expose a slash command that inserts a timestamp — the markup is just plain text you or your bot writes directly into message content. Some third-party bots add their own slash commands as a convenience, but the underlying syntax they produce is the same <t:UNIX:FORMAT> string this page describes.

Can I use a Discord timestamp inside an embed?

Yes. Put the <t:UNIX:FORMAT> string inside an embed's description, a field value, or the footer text, and Discord renders it the same as it would in ordinary message content. This is separate from an embed's dedicated timestamp property, which controls the small date shown next to the embed footer — the two are independent and can be used together.