machineFormatDatetime := machine_format_datetime(Args{unix_time: "1700000000", format: "RFC 3339"})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Formatted Time: " + machineFormatDatetime.formatted_time,
})
Standard Format Date and Time
BlockTime
Format a Unix timestamp into a standardized date and time string.
Inputs
Unix TimeRequired
Unix timestamp to format.
Example: 1700000000
FormatRequired
Standard library format to use.
OptionsRFC 3339ANSICUnix DateRuby DateRFC 822RFC 822ZRFC 850RFC 1123RFC 1123ZRFC 3339Nano
Outputs
Formatted Time
Formatted date/time string.
Example: 2025-12-10T15:04:05Z
Build a bot using blocks like Standard Format Date and Time
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:
machine_format_datetimeInputs
| Field | InventScript name | Value |
|---|---|---|
| Unix Time | unix_time | e.g. "1700000000" |
| Format | format | "RFC 3339", "ANSIC", "Unix Date", "Ruby Date", "RFC 822", "RFC 822Z", "RFC 850", "RFC 1123", "RFC 1123Z", "RFC 3339Nano" |
Outputs
| Field | InventScript name | Value |
|---|---|---|
| Formatted Time | formatted_time | e.g. "2025-12-10T15:04:05Z" |
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.Generate TimecodeGenerate a Discord timestamp timecode from a Unix time.