Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Discord timestamps and Snowflake IDs are fully documented: a timestamp is a Unix time in seconds wrapped in <t:...> markup that each viewer sees in their own timezone and locale, and a Snowflake ID carries its creation time in its upper 42 bits. Colored text in code blocks is the exception. Discord documents fenced code blocks, but the official pages checked for this article do not publish a current ANSI color specification, so color behavior should be treated as unverified.

How Discord dynamic timestamps work

Discord’s API reference defines two forms of timestamp markup. The plain form is <t:TIMESTAMP>, and the styled form is <t:TIMESTAMP:STYLE>. The value is a Unix timestamp expressed in seconds, not milliseconds. Discord states that the rendered result uses the timezone and locale of the user viewing the message, which is why one piece of markup can show different clock times to people in different countries. The reference is the authoritative source for this syntax: Discord’s developer API reference, in its Message Formatting section.

The documentation’s own examples are <t:1618953630> and <t:1618953630:d>. The first is the default timestamp display, and the second requests a style.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Style letters and their display formats

The style letter comes after the second colon. The reference lists nine letters. The example output below is Discord’s own, and the reference notes that the visible date order and wording can change with the viewer’s locale, so treat these samples as illustrations rather than fixed strings.

#1 Best Overall
Sale
Ozeino Gaming Headset for PC, Ps4, Ps5, Xbox Headset with 7.1 Surround Sound Gaming Headphones with Noise Canceling Mic, LED Light Over Ear Headphones for Switch, Xbox Series X/S, Laptop, Mobile White
  • Immersive 7.1 Surround Sound: This gaming headset delivering stereo surround sound for realistic audio. Whether you're in a high-speed FPS battle or losing yourself RPG adventures, this Ps5 headset provides crisp treble, punchy bass, and precise directional cues, giving you a competitive edge
  • Great Humanized Design: Comfortable and breathable permeability protein over-ear pads perfectly on your head, adjustable headband distributes pressure evenly, you’ll enjoy lasting comfort during hours of gaming and suitable for all gaming players of all ages
  • Sensitivity Noise-Cancelling Microphone: 360° omnidirectionally rotatable sensitive microphone, premium noise cancellation, sound localisation, your voice comes through loud and natural, ensuring your teammates catch every callout, even in chaotic battle scenes.
  • Universal Compatibility: This gaming headphone support for PC, Ps5, Ps4, Xbox one, Xbox Series X/S, Switch, Laptop, Mobile Phone and other devices with 3.5mm jack.Note 1: When you use headset on your PC, be sure to connect the "1-to-2 3.5mm audio jack splitter cable" (Red-Mic, Green-audio). (Please note you need an extra Microsoft Adapter when connect with an old version Xbox One controller)
  • Cool style gaming experience: Colorful RGB lights create a gorgeous gaming atmosphere, adding excitement to every match. Heightening immersion for FPS, MOBA, and action titles. These eye-catching lights give your setup a gamer-ready look while maintaining focus on performance. (*Note: The USB connector is for LED lighting only)
Style code Example output in Discord’s reference Meaning in the reference
t 16:20 Short Time
T 16:20:30 Medium Time
d 20/04/2021 Short Date
D April 20, 2021 Long Date
f April 20, 2021 at 16:20 Long Date, Short Time
F Tuesday, April 20, 2021 at 16:20 Full Date, Short Time
s 20/04/2021, 16:20 Short Date, Short Time
S 20/04/2021, 16:20:30 Short Date, Medium Time
R 4 years ago Relative Time

Choosing a style is a question of what the reader needs. Clock-only styles (t, T) suit same-day schedules. Date-only styles (d, D) suit deadlines and birthdays. Combined styles (f, F, s, S) suit event announcements where both matter. The relative style R is the one to use when the reader cares how far away a moment is rather than when it falls on the calendar, and because it is relative it changes as time passes.

Converting a real moment into a timestamp

The number you place inside the markup must be whole seconds since the Unix epoch. To produce one from a known UTC moment:

Rank #2
Sale
Logitech G432 Wired Gaming Headset - Black
  • Enjoy expansive cinematic sound. Big 50 mm audio drivers deliver an incredible sound experience
  • Hear Enemies From All Sides. DTS Headphone:X 2.0 surround sound(1) lets you hear enemies sneaking behind you, special ability cues, and immersive environments. It’s positional clarity that can make the difference between victory and defeat. Experience three-dimensional audio that goes beyond 7.1 channels to make you feel like you’re right in the middle of the action. (1) DTS Headphone:X 2.0 requires Logitech G HUB Software.
  • Be Heard Loud and Clear. The big 6 mm boom mic makes sure you’re heard by gaming partners and mutes when flipped up.
  • Use One Headset For Most Game Platforms. Your headphones work with your PC or Mac via USB DAC or 3.5 mm cable, mobile devices with 3.5 mm cable or with gaming consoles including PlayStationⓇ 5 and PlayStationⓇ 4 (USB wireless stereo sound only), Nintendo Switch (wireless stereo sound when docked)
  • Game for Hours in Comfort. Everything about these headphones is about comfort: The deluxe lightweight leatherette ear cups and headband are made to keep pressure off your ears. Ear cups rotate up to 90 degrees for convenience.
  1. Start with the moment in UTC, for example 2021-04-20 16:20:30.
  2. Convert it to Unix seconds, which counts from 1970-01-01 00:00:00 UTC. Most languages and shells provide this directly.
  3. Place the integer inside the markup, with no decimal point, for example <t:1618953630>.
  4. Append a style letter after a colon only if you want something other than the default display.

If you are generating these values from a millisecond source such as a JavaScript Date.now() call, divide by 1000 and round down first. Passing milliseconds produces a value roughly a thousand times too large, which Discord will render as a date far in the future. That is the most common reason a timestamp looks wrong, and it follows directly from the documented seconds unit.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

How Snowflake IDs encode time

Discord says it uses a Snowflake format derived from Twitter’s design for its unique identifiers. A Snowflake is up to 64 bits, and the bits are split into fixed fields. The top 42 bits hold a millisecond timestamp measured from Discord’s own epoch. The remaining 22 bits identify where and how the ID was generated, and a counter separates IDs created within the same millisecond on the same process.

Rank #3
Sale
Razer Kraken V3 X Wired USB Gaming Headset, Lightweight, Black
  • 285G LIGHTWEIGHT BUILD — Experience superior audio and game for hours without being weighed down by the headset
  • TRIFORCE 40MM DRIVERS — Cutting-edge proprietary design divides the driver into 3 parts for the individual tuning of highs, mids, and lows —producing brighter, clearer audio with richer highs and more powerful lows
  • HYPERCLEAR CARDIOID MIC — An improved pickup pattern ensures more voice and less noise with the sweet spot easily placed at the mouth because of the mic’s bendable design
  • HYBRID FABRIC AND MEMORY FOAM EAR CUSHIONS — Wrapped in a combination of breathable fabric and plush leatherette to provide a snug fit to ensure constant comfort for prolonged gaming
  • 7.1 SURROUND SOUND — Provides accurate positional audio that lets you pinpoint intuitively where every sound is coming from. *Only available on Windows 10 64-bit

Field layout

Bits Size Field Extraction documented by Discord
63–22 42 Timestamp, in milliseconds since the Discord epoch (snowflake >> 22) + 1420070400000
21–17 5 Internal worker ID (snowflake & 0x3E0000) >> 17
16–12 5 Internal process ID (snowflake & 0x1F000) >> 12
11–0 12 Increment, which rises for each ID generated on that process snowflake & 0xFFF

The Discord epoch is 1420070400000 milliseconds, which Discord describes as the first second of 2015. Adding it to the decoded timestamp converts the value back to standard Unix milliseconds.

Getting the creation time from an ID

  1. Copy the ID as text. Do not retype it through a floating-point number, because precision is lost above 253.
  2. Parse it as an unsigned 64-bit integer. In languages with arbitrary-precision integers, such as Python, this is automatic. In JavaScript, use BigInt.
  3. Shift right by 22 bits to discard the lower fields.
  4. Add 1420070400000 to get a Unix time in milliseconds.
  5. Divide by 1000 and round down if you want a seconds value for a <t:...> timestamp.

The result is the millisecond at which Discord’s generator produced the ID. For most objects that carry Snowflakes, this is their creation time, but the reference describes the field as the generation time of the ID, so treat it as the ID’s origin rather than a guaranteed event time for every resource type.

Rank #4
Logitech G335 Wired Gaming Headset (with Flip to Mute Microphone) - Black
  • Lightweight Design: Weighing in at only 8.5 oz (240 g), G335 is smaller and lighter than the G733, features a suspension headband to help distribute weight and is adjustable for a customized fit.
  • All-day Comfort: Soft memory foam ear pads and sports mesh material are comfortable for extended use so you can take your gaming to the next level in style and comfort.
  • Plug and Play: Quickly jump into your game and simply connect with the 3.5 mm audio jack; these colorful headphones are compatible with PC, laptop, gaming consoles, and select mobile devices.
  • Headset Controls: The volume roller is located directly on the ear cup to quickly turn up your game or music, while the mic can be easily flipped up to mute and move it out of the way.
  • Impressive Sound: With 40 mm neodymium drivers, the G335 computer gaming headset delivers crisp, clear stereo sound that makes your game come alive.

Building a Snowflake from a timestamp

The reverse operation is documented too. Given a moment in Unix milliseconds, the lower bound Snowflake for that moment is (timestamp_ms - 1420070400000) << 22. This is useful for building range comparisons, such as finding messages posted after a certain time, because Snowflakes sort in creation order. The worker, process, and increment bits are zero in that construction, so it is a boundary value rather than a real ID.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why IDs must be handled as strings

Discord returns Snowflakes as strings in its HTTP API. The reference explains that this avoids integer overflow in languages that cannot represent 64-bit values exactly, and it advises clients to expect IDs as strings. It also notes that serialization can convert big integers to strings. Store and pass IDs as text, and convert to a 64-bit integer only when you need to decode the timestamp.

Best Value
Sale
Razer BlackShark V2 X Gaming Headset: 7.1 Surround Sound - 50mm Drivers - Memory Foam Cushion - For PC, PS4, PS5, Switch - 3.5mm Audio Jack - Black
  • ADVANCED PASSIVE NOISE CANCELLATION — sturdy closed earcups fully cover ears to prevent noise from leaking into the headset, with its cushions providing a closer seal for more sound isolation.
  • 7.1 SURROUND SOUND FOR POSITIONAL AUDIO — Outfitted with custom-tuned 50 mm drivers, capable of software-enabled surround sound. *Only available on Windows 10 64-bit
  • TRIFORCE TITANIUM 50MM HIGH-END SOUND DRIVERS — With titanium-coated diaphragms for added clarity, our new, cutting-edge proprietary design divides the driver into 3 parts for the individual tuning of highs, mids, and lowsproducing brighter, clearer audio with richer highs and more powerful lows
  • LIGHTWEIGHT DESIGN WITH BREATHABLE FOAM EAR CUSHIONS — At just 240g, the BlackShark V2X is engineered from the ground up for maximum comfort
  • RAZER HYPERCLEAR CARDIOID MIC — Improved pickup pattern ensures more voice and less noise as it tapers off towards the mic’s back and sides

Two practical consequences follow. First, equality checks and dictionary keys should compare the string form. Second, a JSON parser that reads a bare numeric ID into a double will silently change the last digits, so the ID will no longer match the one Discord issued.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

ANSI colors in code blocks: what is and is not documented

What the official Markdown documentation covers

Discord’s Markdown help article describes multiline code blocks, which are made by wrapping text in three backticks on the line before and the line after. This gives a monospaced, boxed block. It is the only part of code-block formatting that the official sources checked here describe.

What is not established

The official pages do not describe an ansi language tag, the escape sequences a client accepts, the color ranges it renders, or how each platform displays them. Searching for those details turns up community posts and guides, but those are not official specifications. The most specific source reviewed is an archived community feature request dated 2023-03-14. It states that Discord’s ANSI formatting at that time supported seven foreground and seven background colors and asked for full RGB escape sequences. That post is user-authored, and it is three years old, so it does not establish what current Discord clients render.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A practical approach

  • Use a fenced code block for any output that needs monospace alignment. This part is documented.
  • Do not rely on color for meaning in an announcement or support message. Readers on some clients may see plain text.
  • Before publishing a color-dependent snippet, paste it into the client you are targeting, on each platform your audience uses, and check the rendered result.
  • If the color behavior matters to a bot or integration, check the current Discord developer documentation and the behavior of the specific client rather than a third-party tutorial.

Troubleshooting timestamps and IDs

  • A timestamp shows a date decades or centuries away. The value is probably in milliseconds. Divide by 1000 and retry.
  • A timestamp shows 1970. The value is probably zero, a null that was converted to 0, or an ID that was used where a time was expected.
  • The decoded date is wrong by a few hours. Check whether you converted from local time instead of UTC before calling the Unix conversion. The Discord formatting itself shifts to the viewer’s timezone, but the stored value is absolute.
  • An ID decodes to a different time after a round trip through JSON. The ID was parsed as a floating-point number. Keep it as a string.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.