Datetime#
The Antavo Enterprise Loyalty Cloud offers numerous ways of entering date/time into the system. The date object can be accessed in a Backoffice form field using the following syntax:
date: <date object>
# e.g.
date: -3 months
Note
The date format in Antavo events is YYYY-MM-DD
Datetime objects#
Warning
date objects are time-insensitive but the following date-related keywords can be used. If a date keyword is used in a datetime context e.g., Y-m-d H:i:s
formatting, the time component will be returned as 00:00:00
- dayname:
sunday, monday, tuesday, wednesday, thursday, friday, saturday, sun, mon, tue, wed, thu, fri, sat
- monthnames:
January, February, March, April, May, June, July, August, September, October, November, December
- daytext:
weekday, weekdays
- number:
integer, positive and negative accepted ([+-]?[0-9]+)
- ordinal:
first, second, third, fourth, fifth, sixth, seventh, eighth, ninth, tenth, eleventh, twelfth, next, last, previous, this
- relative text:
next, last, previous, this
- unit:
sec, second, min, minute, hour, day, fortnight, fortnight, month, year, weeks
Keyword |
Description |
Example |
---|---|---|
yesterday |
Midnight of yesterday |
yesterday |
midnight |
The time is set to 00:00:00 |
|
today |
The time is set to 00:00:00 |
|
now |
Now - this is simply ignored |
|
noon |
The time is set to 12:00:00 |
yesterday noon |
tomorrow |
Midnight of tomorrow |
|
back of hour |
15 minutes past the specified hour |
back of 7pm, back of 15 |
front of hour |
15 minutes before the specified hour |
front of 5am, front of 23 |
first day of |
Sets the day of the first of the current month. This phrase is best used together with a month. |
first day of January 2008 |
last day of |
Sets the day to the last day of the current month. This phrase is best used together with a month. |
last day of next month |
ordinal |
Calculates the x-th week day of the current month. |
first sat of July 2008 |
last |
Calculates the last week day of the current month. |
last sat of July 2008 |
number |
Handles relative time items where the value is a number. |
+5 weeks, 12 day, -7 weekdays |
ordinal |
Handles relative time items where the value is text. “fifth day” |
second month |
ago |
Negates all the values of previously found relative time items. |
2 days ago, 8 days ago 14:00, 2 months 5 days ago, 2 months ago 5 days, 2 days ago |
dayname |
Moves to the next day of this name. |
Monday |
reltext |
Handles the special format. “weekday + last/this/next week”. |
Monday next week |