now := get_current_datetime_basic()
send_text_message(Args{
channel_id: trigger.channel_id,
message_content: "Current Time (Unix): " + now.current_time_unix,
})
Get Current Date and Time
Get the current UTC date and time in various formats.
Outputs
Current UTC time in Unix seconds.
Example: 1700000000
Current UTC time in Unix milliseconds.
Example: 1700000000000
Current UTC year.
Example: 2025
Current UTC month number.
Example: 12
Current UTC month name.
Example: December
Current UTC day of week (0=Sunday).
Example: 1
Current UTC day of month.
Example: 10
Current UTC weekday name.
Example: Wednesday
Current UTC date formatted as MM/DD/YYYY.
Example: 12/10/2025
Current UTC date formatted as DD/MM/YYYY.
Example: 10/12/2025
Current UTC hour (24h).
Example: 15
Current UTC minute.
Example: 04
Current UTC second.
Example: 05
Current UTC millisecond.
Example: 123
Current UTC time formatted as HH:MM:SS.
Example: 15:04:05
Current UTC time formatted as HH:MM.
Example: 15:04
Human-readable relative time.
Example: just now
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
get_current_datetime_basicOutputs
| Field | InventScript name | Value |
|---|---|---|
| Current Time (Unix) | current_time_unix | e.g. "1700000000" |
| Current Time (Unix Milli) | current_time_unix_milli | e.g. "1700000000000" |
| Current Date (Year) | current_date_year | e.g. "2025" |
| Current Date (Month) | current_date_month | e.g. "12" |
| Current Date (Month Name) | current_date_month_name | e.g. "December" |
| Current Date (Day of Week) | current_date_day_of_week | e.g. "1" |
| Current Date (Day of Month) | current_date_day_of_month | e.g. "10" |
| Current Date (Day Name) | current_date_day_name | e.g. "Wednesday" |
| Current Date (MM/DD/YYYY) | current_date_mm_dd_yyyy | e.g. "12/10/2025" |
| Current Date (DD/MM/YYYY) | current_date_dd_mm_yyyy | e.g. "10/12/2025" |
| Current Time (Hours) | current_time_hours | e.g. "15" |
| Current Time (Minutes) | current_time_minutes | e.g. "04" |
| Current Time (Seconds) | current_time_seconds | e.g. "05" |
| Current Time (Milliseconds) | current_time_milliseconds | e.g. "123" |
| Current Time (HH:MM:SS) | current_time_hh_mm_ss | e.g. "15:04:05" |
| Current Time (HH:MM) | current_time_hh_mm | e.g. "15:04" |
| Current Time (Relative) | current_time_relative | e.g. "just now" |