Relative Time Formats
Xano uses relative time formats from php.net.
You can use these relative time formats alongside Timestamp Filters.
For example: now, last Monday, +7 days, etc. (Relative times normally don’t have any timezone information, so it will often be important to reference the timezone in any type of filter.)
Format | Description | Examples |
---|---|---|
'yesterday' | Midnight of yesterday | "yesterday 14:00" |
'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' | 15 minutes past the specified hour | "back of 7pm", "back of 15" |
'front of' | 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 usually best used together with a month name following it as it only effects the current month | "first day of January 2008" |
'last day of' | Sets the day to the last day of the current month. This phrase is usually best used together with a month name following it as it only effects the current month | "last day of next month" |
| Calculates the | "first sat of July 2008" |
'last' | Calculates the last week day of the current month. | "last sat of July 2008" |
| Handles relative time items where the value is a number. | "+5 weeks", "12 day", "-7 weekdays" |
( | Handles relative time items where the value is text. | "fifth day", "second month", "last day", "previous year" |
'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" |
| Moves to the next day of this name. (See note) | "Monday" |
| Handles the special format "weekday + last/this/next week". | "Monday next week" |
Note:
Relative statements are always processed after non-relative statements. This makes "+1 week july 2008" and "july 2008 +1 week" equivalent.
Exceptions to this rule are: "yesterday", "midnight", "today", "noon" and "tomorrow".
Note that "tomorrow 11:00" and "11:00 tomorrow" are different. Considering today's date of "July 23rd, 2008" the first one produces "2008-07-24 11:00" where as the second one produces "2008-07-24 00:00". The reason for this is that those five statements directly influence the current time.
Keywords such as "first day of" depend on the context in which the relative format string is used.
Last updated