Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce start_x datetime keywords #21

Open
wants to merge 2 commits into
base: gh-pages
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions versions/1.0/time-series/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,37 @@ Example of the `start` and `end` time range _reflected_ in the response body.

# <a href="#time-series-datetime" id="time-series-datetime" class="headerlink"></a> Relative Datetime Format

APIs **MUST** accept the `now` keyword with optional modifiers when handling relative datetime.
APIs **MUST** accept a datetime keyword with optional modifiers when handling relative datetime.

The following modifiers and time ranges **MAY** be used in conjunction with the `now` keyword following the format `now[+|-][time_integer][yMwdms]`.
The following modifiers and time ranges **MAY** be used in conjunction with a datetime keyword following the format `(now|start_day|start_week|start_month|start_year)[+|-][time_integer][yMwdms]`.

* `+` add time range to `now` datetime keyword.
* `now` uses the current datetime.

* `-` subtract time range from `now` datetime keyword.
* `start_day` uses the midnight of today.

* `start_week` uses the midnight of Monday of the current week.

* `start_month` uses the midnight of the fist day of the current month.

* `start_year` uses the midnight of the first day of the current year.

* `+` add time range to a datetime keyword.

* `-` subtract time range from a datetime keyword.

* `[time_integer]` time integer value.

* `[y]`ears time range to add/subtract to `now` datetime keyword.
* `[y]`ears time range to add/subtract to a datetime keyword.

* `[M]`onths time range to add/subtract to `now` datetime keyword.
* `[M]`onths time range to add/subtract to a datetime keyword.

* `[w]`eeks time range to add/subtract to `now` datetime keyword.
* `[w]`eeks time range to add/subtract to a datetime keyword.

* `[d]`ays time range to add/subtract to `now` datetime keyword.
* `[d]`ays time range to add/subtract to a datetime keyword.

* `[m]`inutes time range to add/subtract to `now` datetime keyword.
* `[m]`inutes time range to add/subtract to a datetime keyword.

* `[s]`econds time range to add/subtract to `now` datetime keyword.
* `[s]`econds time range to add/subtract to a datetime keyword.

> Note: If a requested datetime falls on an invalid date when using month time range `[M]`, APIs must add/subtract days until a valid datetime is found.

Expand Down Expand Up @@ -145,4 +155,4 @@ This example gets time series data using an [absolute datetime](#time-series-abs
"end": "2018-06-17T21:43:25Z",
...
}
```
```