Time and date variables

You may include current time and/or date in the prompt via the following pre-defined variables:

In order to use local time, instead of UTC, define your time zone via the timezone variable. Use IANA timezone identifier, for example, “Europe/Paris” or “America/NewYork”.

Example 1

Prompt:
Current time is {current_time}.
Greet user according to the current time.

Variables:
timezone = Europe/Paris

 

Alternatively, you can use the following syntax to specify timezone as part of time variable element:
{variable_name timezone=value}

Example 2

Prompt:
Current day is {current_day timezone=Europe/Madrid}.
If current day is Saturday or Sunday, tell user that the shop is closed.

You can use the format element to customize the time variable format. The format element uses Python datetime compatible syntax and should be enclosed in quotes.

Custom time and date format

You can use the format element to customize the time variable output format:

Current time is {current_time format="%H:%m"}.

The format element must be enclosed in quotes and may use the following components.

Date components

Component Meaning Example
%Y Year (4 digits) 2026
%y Year (2 digits) 26
%m Month (01–12) 02
%B Full month name February
%b Abbreviated month name Feb
%d Day of month (01–31) 22
%e Day of month (space padded, may not work on Windows) 22
%A Full weekday name Sunday
%a Abbreviated weekday name Sun
%w Weekday number (0=Sunday, 6=Saturday) 0
%j Day of year (001–366) 053
%U Week number (Sunday-start, 00–53) 07

Time components

Component

Meaning

Example

%H

Hour (24h, 00–23)

13

%I

Hour (12h, 01–12)

01

%p

AM/PM

PM

%M

Minute (00–59)

05

%S

Second (00–59)

30

%f

Microseconds (000000–999999)

123456

%Z

Time zone name

UTC, EST

%z

UTC offset

+0200