Videos
Date and Time
A 2.5-minute tour of Kognitos's date and time operations — and how to handle a time-zone exception inline.
What you'll learn
A 2.5-minute tour of Kognitos's date and time operations, plus a real-world tip for resolving an invalid time-zone exception without leaving the editor.
Four things demonstrated
- Get the current date and time: write get the current date and get the current time, then Ctrl+Enter to run. Kognitos returns the values in the user's default zone (Chicago in the demo) and also shows the GMT equivalent.
- Set a department time zone: write the department's time zone is America/Chicago to set the active time zone for everything downstream. Useful when you want consistent results across users.
- Exception-driven discovery: a small typo (an extra trailing “s”) triggers an invalid time zone exception. Kognitos surfaces the list of valid IANA time-zone strings right in the UI so the builder can pick the right one without leaving the editor.
- Custom date formatting: convert any date to a text string using a pattern like
%month %day %year— Kognitos applies the formatting only to the new line, leaving previous values unchanged.
Why this matters
Time-aware automations — invoice due dates, SLA tracking, scheduled reports — depend on correct zones and formats. Kognitos exposes these as plain-English operations rather than developer-only library calls, so any operations builder can read and tweak them.
Questions answered in this video
How do I get the current date and time in Kognitos?
Write get the current date and get the current time as separate English lines and run them. Kognitos returns values for the active department's time zone.
How do I change the time zone Kognitos uses?
Use a line like the department's time zone is America/Chicago. This sets the active zone for the rest of the process.
What if I type an invalid time-zone name?
Kognitos raises an invalid time zone exception and displays the full list of valid IANA zones directly in the editor, so you can pick the correct one without consulting external docs.
How do I format a date as a custom text string?
Use a line like convert the above to a text where the format is "%month %day %year". Only the line you change is re-run; earlier values stay the same.