When querying for points, the date from and date to must be specified in one of the ways below. To show more recent dates first, flip date from and date to.
- MIN / MAX – queries for the minimal or maximal dates
- Relative Period format – see below for examples and reference
- ISO date – either YYYY-MM-DD or YYYY-MM-DD MM:HH or YYYY-MM-DD MM:HH:SS
- milliseconds since epoch – any numeric input will be interpreted as milliseconds from epoch (for example 2020 means 2020 milliseconds since epoch, NOT the year 2020)
- Native date – this format depends on the tool used
Date Input Operators
Note that date input operators are only supported in df/dt, and not when using dates as parameters to operators (e.g. in @asof:-2db
there is no support for further operating on the -2db
).
Operator | Examples | Notes |
@excl | 2019-01-01@excl | By default, date from and date to are inclusive, so the date specified will be included in the result. The @excl operator excludes the date from the result. |
@cal:cal-name | -5d@cal:us-holiday | Only applies to Relative Period format. Applies a calendar to relative dates. Useful for doing something like 5 business days back. The calendar name must be defined on the Shooju account level.
The cal-name must be the value of the cal_id field of a shooju series. There must be only one such shooju series. The point values must be equal 1 on the working days and missing (null) on the non-working days. |
Relative Period Format
- The relative period is always with respect to right now in UTC.
- General format is one or multiple space-separated (-/+)(number)(period letter)(optional b)
- A b after a period letter moves to the beginning of that period.
Relative Period Examples
Relative Period | Meaning | Value if now is 2015-07-04 14:00 |
-1y | 1 year ago | 2014-07-04 14:00 |
2y | 2 years into the future | 2017-07-04 14:00 |
-5m | 5 minutes ago | 2015-07-04 13:55 |
-5M | 5 months ago | 2015-02-04 14:00 |
-2d | two days ago | 2015-07-02 14:00 |
-1y -2M | a year and two months ago | 2014-05-04 14:00 |
0s | right now (offset by 0 seconds) | 2015-07-04 14:00 |
0db | beginning of today (0 days offset, but beginning) | 2015-07-04 00:00 |
-1y 0Mb | the beginning of today's month a year ago | 2014-07-01 00:00 |
-2db | two days ago, the beginning of the day | 2015-07-02 00:00 |
Period Letter Reference
Period Letter | Meaning |
y | Yearly |
q | Quarterly |
M | Monthly |
w | Weekly |
d | Daily |
h | Hourly |
m | Minute |
s | Second |