parseDatetime := parse_datetime(Args{
input_datetime: "12/10/2025 15:04",
date_format: "MM/DD/YYYY",
time_format: "HH:MM",
})
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Parsed Time (Unix): " + parseDatetime.parsed_time_unix,
})
Parse Date and Time
BlockTime
Parse a date and time into a Unix timestamp with a variety of parsing options.
If both date and time are requested, they must be provided in the order of date then time, and be separated by a space.
Inputs
Input DateTimeRequired
User-provided date and/or time to parse.
Example: 12/10/2025 15:04
Date FormatRequired
Expected date format.
OptionsMM/DD/YYYYDD/MM/YYYYYYYY/MM/DD
Time FormatRequired
Expected time format.
OptionsHH:MM:SSHH:MMHH:MM:SS AM/PMHH:MM AM/PM
Standardized Format
If set, the date/time format will be ignored and the standardized format will be used.
OptionsRFC 3339ANSICUnix DateRuby DateRFC 822RFC 822ZRFC 850RFC 1123RFC 1123ZRFC 3339Nano
Outputs
Parsed Time (Unix)
Parsed time in Unix seconds.
Example: 1700000000
Build a bot using blocks like Parse 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:
parse_datetimeInputs
| Field | InventScript name | Value |
|---|---|---|
| Input DateTime | input_datetime | e.g. "12/10/2025 15:04" |
| Date Format | date_format | "MM/DD/YYYY", "DD/MM/YYYY", "YYYY/MM/DD" |
| Time Format | time_format | "HH:MM:SS", "HH:MM", "HH:MM:SS AM/PM", "HH:MM AM/PM" |
| Standardized Format | standardized_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 |
|---|---|---|
| Parsed Time (Unix) | parsed_time_unix | e.g. "1700000000" |
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.Standard Format Date and TimeFormat a Unix timestamp into a standardized date and time string.Generate TimecodeGenerate a Discord timestamp timecode from a Unix time.