Skip to main content

Relative Time Notation

Working with time series often requires a way of referring to specific time frames or specific points in time, with respect to some given moment. This happens for example when a user wants to explain the time horizons for which they wish to forecast, or when they need to clearly convey the data availability (when a predictor updates, which samples become available though this update). Here arises a need for a straightforward relative time notation.

A relative time notation makes it easier to describe many aspects required to build accurate models. A relative time notation has the following form: X +- integer relative to datetime (the given moment), where X can represent either D (day), H (hour), Q (quarter hour) or S (samples). This notation always describes a time period in order of magnitude X, that starts at the datetime (the given moment) ofsett by the given number of timeframes of length X. Parts of datetime (the given moment) that are measured in a smaller granularity than X are ignored. The table below provides some examples to illustrate this notation. In this table, only examples using D, H and Q are provided.

Relative TimeDatetime (given moment)Denotes the whole timeframe
D+128-01-2012 22:13:56from 29-01-2012 00:00:00 to 29-01-2012 23:59:59
D+028-01-2012 22:13:56from 28-01-2012 00:00:00 to 28-01-2012 23:59:59
D-128-01-2012 22:13:56from 27-01-2012 00:00:00 to 27-01-2012 23:59:59
H+128-01-2012 22:13:56from 28-01-2012 23:00:00 to 28-01-2012 23:59:59
H+028-01-2012 22:13:56from 28-01-2012 22:00:00 to 28-01-2012 22:59:59
H-128-01-2012 22:13:56from 28-01-2012 21:00:00 to 28-01-2012 21:59:59
Q+128-01-2012 22:13:56from 28-01-2012 22:15:00 to 28-01-2012 22:29:59
Q+028-01-2012 22:13:56from 28-01-2012 22:00:00 to 28-01-2012 22:14:59
Q-128-01-2012 22:13:56from 28-01-2012 21:45:00 to 28-01-2012 21:59:59

Relative time notations using S (samples) are used in the same way; S is exchanged for the sampling rate of the data. The table below provides some examples to illustrate this notation using S.

Sampling RateRelative TimeDatetime (given moment)Denotes the whole timeframe
1 hourS+128-01-2012 22:13:56from 28-01-2012 23:00:00 to 28-01-2012 23:59:59
1 minuteS+128-01-2012 22:13:56from 28-01-2012 22:14:00 to 28-01-2012 22:14:59
10 minutesS+128-01-2012 22:13:56from 28-01-2012 22:20:00 to 28-01-2012 22:29:59