Handbook · Reference · Blockly · Date and time

Blockly: Date and time

Where in the UI. Scripts tab toolbox.

Clock, duration, format, weekday helpers, datetime writes.

Block idRead asPurpose
containd_get_datetimeget datetimecallHost(getCurrentDateTime)
containd_add_duration_to_isoadd duration to isocallHost(addDurationToIso)
containd_diff_iso_daysdiff iso dayscallHost(diffIsoDays)
containd_compare_isocompare isocallHost(compareIso)
containd_format_isoformat isocallHost(formatIso)
containd_get_datetime_partget datetime partmonth is 1–12; timezone local|utc
containd_create_datetime_from_partscreate datetime from partsmonth 1–12; hour/minute/second default 0; returns ISO
containd_set_datetime_partset datetime partkeep other parts; month 1–12; returns ISO
containd_get_current_weekday_indexget current weekday index0=Sun … 6=Sat
containd_get_current_weekday_nameget current weekday nameEng short Sun…Sat
containd_get_last_weekday_beforeget last weekday beforeon-or-before (passthrough if same day); preserves clock time; returns ISO
containd_get_next_weekday_afterget next weekday afteron-or-after (passthrough if same day); preserves clock time; returns ISO
containd_write_datetime_item_fieldwrite datetime item fieldISO 8601 datetime string
containd_write_datetime_category_propertywrite datetime category propertyISO 8601 datetime string