Discord Timestamp Guide 2026: Format Styles, Generators & Bot Code

Published on

Discord timestamp syntax, all 7 format flags, and working code for discord.js and discord.py. Generate relative countdowns and local times without timezone confusion.

Discord Timestamp Guide 2026: Format Styles, Generators & Bot Code

Discord timestamps turn a Unix epoch number into text like "in 15 minutes" that updates automatically and shows every user their own local time. No timezone arguments, no message edits.

Below: the full syntax, all 7 format flags, how to generate them in Python and JavaScript, and how to use them in event reminder bots.


1. Discord Timestamp Syntax Overview

Discord parses timestamps using a special markdown tag formatted as:

<t:UNIX_TIMESTAMP:STYLE>
  • UNIX_TIMESTAMP: The number of seconds (not milliseconds!) since January 1, 1970 UTC.
  • STYLE: A single-letter flag determining whether Discord displays a short time, full date, or dynamic countdown.

If you omit the :STYLE parameter, Discord defaults to <t:TIMESTAMP:f> (Short Date/Time).


2. Complete Format Styles & Output Table

All supported timestamp style flags:

FlagNameMarkdown ExampleExample Output (User's Local Time)
:tShort Time<t:1787947200:t>20:00 or 8:00 PM
:TLong Time<t:1787947200:T>20:00:00 or 8:00:00 PM
:dShort Date<t:1787947200:d>29/08/2026 or 08/29/2026
:DLong Date<t:1787947200:D>29 August 2026 or August 29, 2026
:fShort Date/Time (default)<t:1787947200:f>29 August 2026 20:00
:FLong Date/Time<t:1787947200:F>Saturday, 29 August 2026 20:00
:RRelative Time<t:1787947200:R>in 45 minutes or 2 hours ago

3. Why Relative Timestamps (:R) Matter

:R is the most useful flag for event bots:

  • Auto-updating. The text ticks down from "in 1 hour" to "in 5 minutes" to "just now" without editing the message.
  • Works both ways. After the event it switches to "10 minutes ago", "yesterday", etc.
  • No timezone arguments. Discord converts the epoch directly to whatever timezone the viewer has set on their device.

4. How to Generate Timestamps in Python (discord.py)

In Python, use the datetime module or time.time() to generate the integer Unix timestamp:

import time
from datetime import datetime, timezone, timedelta
import discord

# Method 1: Relative time from now (e.g., event in 30 minutes)
event_time = int(time.time()) + (30 * 60)
message_1 = f"Tournament begins <t:{event_time}:R>!"

# Method 2: Specific calendar date and time (UTC)
match_date = datetime(2026, 8, 29, 20, 0, tzinfo=timezone.utc)
match_epoch = int(match_date.timestamp())
message_2 = f"Match kickoff: <t:{match_epoch}:F> (<t:{match_epoch}:R>)"

# Output in Discord:
# "Match kickoff: Saturday, August 29, 2026 8:00 PM (in 2 hours)"

Using discord.utils.format_dt:

from discord.utils import format_dt

future_dt = datetime.now(timezone.utc) + timedelta(hours=2)
formatted = format_dt(future_dt, style="R")  # Returns "<t:1787947200:R>"

5. How to Generate Timestamps in JavaScript (discord.js)

In JavaScript / TypeScript, divide Date.now() or date.getTime() by 1000 and use Math.floor():

const { time, TimestampStyles } = require('discord.js');

// Method 1: Using pure JavaScript
const futureTimestamp = Math.floor(Date.now() / 1000) + (60 * 60); // 1 hour from now
const text = `Server wipe happens <t:${futureTimestamp}:R> (<t:${futureTimestamp}:F>)`;

// Method 2: Using discord.js helper functions
const now = new Date();
const formattedRelative = time(now, TimestampStyles.RelativeTime);
const formattedFull = time(now, TimestampStyles.LongDateTime);

6. How to Get a Timestamp Manually (Without Code)

If you are writing a manual announcement in Discord:

  1. Open your browser console or visit a Unix converter.
  2. Run Math.floor(Date.now() / 1000) or Math.floor(new Date("2026-08-29T20:00:00Z").getTime() / 1000).
  3. Copy the 10-digit number and type <t:YOUR_NUMBER:R> directly into Discord chat.

7. Hosting a 24/7 Reminder or Countdown Bot

A timestamp bot that sleeps between requests defeats the purpose. If it is offline when the countdown hits zero, nobody sees the alert.

Space-Node Discord bot hosting keeps the process running around the clock. The Growth plan (€0.50/month, 512 MB RAM) handles a reminder bot with room to spare. Node.js 20/22, Python 3.11/3.12, Java, and Go are all supported. Auto-restart on crash is included.

Keep Your Bot Online 24/7

Reliable Discord bot hosting powered by enterprise AMD Ryzen 9 hardware. Start free, upgrade anytime with guaranteed uptime.