Here's how to easily manipulate date variables to customize your chatbots even
more.
These "magic" variables are dynamically processed on display and in
conditions.
It becomes very easy to say "good evening" instead of "hello", answer that the
physical shop is closed this Sunday, but will be open next Tuesday etc ...

Here is the list of "magic" variables reserved for dates:
{{bn_date_minute}}
Minute (01...60)
{{bn_date_hour}}
Hour (01...24)
{{bn_date_day}}
Day (01...31)
{{bn_date_month}}
Month (01...12)
{{bn_date_year}}
Year (1900...)
{{bn_date_Yday}}
Day of the year (1...365)
{{bn_date_Wday}}
Day of the week (1...7) 1 = Sunday, 2 = Monday... 7 = Saturday

{{bn_date_WdayTxt}}

Day of the week, text. (monday, tuesday...)
{{bn_date_Period}}
Period of the day. Very useful to customize the home !
1 = morning
2 = afternoon
3 = evening
4 = night

Example:

{{bn_date_TodayYMD}}
Display date in "computer" format (database): 2018/04/28
{{bn_date_TodayYMDT}}
Display the date in "computer" format (database) + time: 2018/04/28 11:18
{{bn_date_TodayMDY}}
Displays the date US format: 04/28/2018
{{bn_date_TodayMD}}
Display the date format US without the year: 04/28
{{bn_date_TodayMDYT}}
Displays the date format US + time: 04/28/2018 11:18
{{bn_date_TodayMDT}}
Display date US format + time without year: 04/28 11:18
{{bn_date_TodayMDYTXT}}
US date in text format: Friday May 4th 2018
{{bn_date_TodayMDTXT}}

Displays the date US format in text without the year: Friday May 4th

{{bn_date_TodayDMY}}
Display the date format EU: 28/04/2018

{{bn_date_TodayDM}}
Display the date format EU without the year: 28/04

{{bn_date_TodayDMYT}}
Display the date format EU + time: 28/04/2018 11:18

{{bn_date_TodayDMT}}
Display the date format EU + time, without the year: 28/04 11:18

{{bn_date_TodayDMYTXT}}
Displays the date EU format in text: Friday 4 May 2018

{{bn_date_TodayDMTXT}}
Displays the date EU format in text without the year: Friday 4 May

{{bn_date_timestamp}}
Gives the current timestamp, that is, the number of seconds elapsed since January
1st 1970.
This is useful for measuring the time spent between 2 events.

We take into account the TimeZone of the user. Specifically at the same time, a
chatbot can now display "Good morning" to a French and "Good night" to a
Japanese using the magic variable {{bn_date_Period}}.

Dates are more manipulable with options!

_-3_min
_+60_sec
_+1_hour
_-2_day
_+7_week
_etc...

Example:

{{bn_date_TodayDMY_+2_week}}
Will return the date it will be exactly in 2 weeks.

It works on all the previous functions, like:
{{bn_date_TodayDMY_+25_day}}
Which will return the date to + 25 days.

It is also possible to use the local timezone (France) Chatbot instead of that of the
user by adding _Local before the period

{{bn_date_hour}} -> User time (Japanese)
{{bn_date_local_hour}} -> Time in the timezone of the bot (Paris by default)


Avez-vous trouvé votre réponse?