Generate Timecode

BlockTime

Generate a Discord timestamp timecode from a Unix time.

Inputs

Unix TimeRequired

Unix timestamp in seconds.

Example: 1735689600

FormatRequired

Discord timecode format style.

OptionsF (Wednesday, January 1, 2025 12:00 AM)f (January 1, 2025 12:00 AM)D (January 1, 2025)d (01/01/2025)s (01/01/2025, 12:00 AM)S (01/01/2025, 12:00:00 AM)t (12:00 AM)T (12:00:00 AM)R (Relative Time)

Outputs

Timecode

Formatted Discord timecode string.

Example: <t:1735689600:d>

Build a bot using blocks like Generate Timecode

Use this block in our visual flow editor. Bots are hosted 24/7 for free on inventor.bot.

Advanced Documentation

This documentation can be useful when using code mode. View as Markdown

ID: generate_timecode

Inputs

FieldInventScript nameValue
Unix Timeunix_timee.g. "1735689600"
Formatformat"F (Wednesday, January 1, 2025 12:00 AM)", "f (January 1, 2025 12:00 AM)", "D (January 1, 2025)", "d (01/01/2025)", "s (01/01/2025, 12:00 AM)", "S (01/01/2025, 12:00:00 AM)", "t (12:00 AM)", "T (12:00:00 AM)", "R (Relative Time)"

Outputs

FieldInventScript nameValue
Timecodetimecodee.g. "<t:1735689600:d>"

Example InventScript

timecode := generate_timecode(Args{unix_time: "1735689600", format: "d (01/01/2025)"})
send_text_message(Args{
	channel_id:      trigger.channel_id,
	message_content: "Timecode: " + timecode.timecode,
})

More time blocks