Represents a contiguous span of time delineated by an inclusive of a set of dates.
Name | Data Type | Description |
---|---|---|
Start | DateTime |
The inclusive beginning of the range. The time component of a supplied DateTime object will be removed when using DateRange as a parameter |
End | DateTime |
The inclusive end of the range. The time component of a supplied DateTime object will be set to a suitable representation of the maximum possible time value based on the precision of the underlying datastore’s DateTime data type when using DateRange as a parameter |
DateRange
objects used as parameters for GET-based API endpoints can be constructed by supplying the individual property names and values in the query string.
Dates passed to the API have to be parsed from their string representation and it is important that ambiguous representations be avoided. For example, the value "01-02-03" could be interpreted as January 2nd, 2003 or it could be interpreted as February 3rd, 2001. A more explicit way to express either of these two dates would be "01-02-2003" and "2001-02-03" respectively. For more information regarding proper format, please refer to the Microsoft Docs for DateTime.Parse
.
Alternate separator characters can be used to avoid the need of URL encoding a date when passing it as a parameter to GET-based endpoints via the query string. For example, the date "May 1st, 2020" may be passed by using the default cultural separator character of "/" and encoded as "5%2F1%2F2020" or it can be passed using an alternate separator character of "-", which does not need encoding, as "5-1-2020".