Skip to main content

Time

Time blocks create dates, convert between units, and turn durations into text a person can read. Anything with a cooldown, a ban length, a reminder or an "account created" line uses them.

The Time category

Getting a date​

BlockReturns
now in msThe current time as a number of milliseconds.
current dateThe current time as a date.
create dateA date built from a millisecond timestamp, or from date text like 2026-09-22T15:00 or September 22, 2026 3:00 PM. A time on its own, like 3:00, is not a date.

A timestamp is a plain number: how many milliseconds have passed since the start of 1970. A date is a richer value that Discord blocks understand. create date from time converts one into the other.

Time of day​

When the time is

when the time is ... in ... runs the blocks inside every day when the clock reaches that time. It is an event of its own: put it anywhere, not inside another event. The last dropdown picks the time zone; the default is the local time of the machine your bot runs on.

Any of the three fields can be set to any, which matches every value:

SettingRuns
15 : 00 : 00Every day at 3:00pm
any : 00 : 00Every hour, on the hour
any : any : 00Every minute
15 : 00 : anyOnce a second for the whole minute of 3:00pm

Is the time

is the time ... in ... is true when the clock matches, on any day. Use it in an if to only allow something at certain hours: is the time 22 : any : any is true for the whole hour from 10pm.

Discord timestamps​

Timestamp from date

create timestamp from date produces the special text Discord renders as a live, local-time timestamp in a message, for example "in 3 hours" or "Today at 14:05". The dropdown picks the style:

StyleLooks like
Short time14:05
Long time14:05:32
Short date09/09/2026
Long date9 September 2026
Short date and time9 September 2026 14:05
Long date and timeWednesday, 9 September 2026 14:05
Relativein 3 hours

This is much better than writing a date yourself, because Discord shows it in each viewer's own time zone.

Converting and comparing​

BlockWhat it does
convertConverts a number between milliseconds, seconds, minutes, hours, days and weeks.
operationAdds or subtracts an amount of time from a date.
betweenHow much time separates two dates.

milliseconds between date ... and date ... is how you work out how long ago someone joined, or how long until a ban expires.

Durations as text​

BlockWhat it does
string to msTurns text like 10m, 2h or 7d into milliseconds.
ms to stringTurns milliseconds into text like 10m or, with long display on, 10 minutes.

These two are what make a /mute @user 10m command possible: read the duration as text from the slash command option, convert it with turn time string to milliseconds, and pass the result to the timeout block.

A worked example: a daily message​

  1. Drag out when the time is and set it to 09 : 00 : 00 in your time zone.
  2. Inside it, get channel with ID and send "Good morning!" to it.

Example​

A cooldown message that reads naturally:

  1. cooldown left for user ... on command ... from Cooldowns gives you milliseconds.
  2. turn milliseconds to time string with long display on gives you "2 minutes".
  3. Reply with create text with "Try again in " and that value.