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,
})
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_timecodeInputs
| Field | InventScript name | Value |
|---|---|---|
| Unix Time | unix_time | e.g. "1735689600" |
| Format | format | "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
| Field | InventScript name | Value |
|---|---|---|
| Timecode | timecode | e.g. "<t:1735689600:d>" |
Example InventScript
More time blocks
Get Current Date and TimeGet the current UTC date and time in various formats.Parse Unix TimeParse a Unix timestamp into a human-readable date and time.Get Snowflake TimestampConvert a Discord snowflake ID into a creation date and time.Sleep / WaitPause the flow for a specified duration.Parse Relative TimeParse a user-provided relative time string into a Unix timestamp.Modify TimeAdd or subtract time from a Unix timestamp.Get Specific TimeGet a specific time in the future or past in a variety of formats.Truncate TimeTruncate a Unix timestamp to a given period.Parse Month NameParse a month name into a number.Parse Date and TimeParse a date and time into a Unix timestamp with a variety of parsing options.Standard Format Date and TimeFormat a Unix timestamp into a standardized date and time string.