Dates format
The Trakopolis API server supports dates in both UTC and local timezone for division. It uses subset of ISO 8601 format to represent date and time:
- Local time: "2012-12-20T11:22:33" - {yyyy-MM-ddTHH:mm:ss}
- UTC time: "2012-12-20T11:22:33Z" - {yyyy-MM-ddTHH:mm:ssZ}
If string representation of date ends with "Z" character it is treated as UTC date. If "Z" is omited, date is in local timezone for calling division.
Dates returned by the API server
By default API server always returns dates in UTC. To change this you should pass ReturnUTC=false property in HTTP header of your request to the API server. Please refer to "HTTP Header Parameters" section for details.
If you requested to use local time and API server returns data of multiple divisions within one response, it will convert date and time according to timezone configuration of every division.
Dates accepted by the API server
Some API requests includes date/time filter parameters that are passed using query string. The Trakopolis API server accepts both UTC and local time. It detects proper timezone automatically, based on value passed in query string. If value ends with "Z" - it is treated as UTC, otherwise - local time of requested division. Internally most API methods operate with UTC time and if local time is specified, it is automatically converted to UTC prior to execution.
Please note, that local time is applied only for requested division, but not its subdivisions. For example:
/api/10/alerts?includechilddivisions=true&startdatetime=2012-12-20T11:00:00
In this request API server will take input time as local time of division with ID=10 (11am 20th Dec 2012) and convert it to UTC time. If division ID=10 has subdivisions with different timezones, then actual local time of filter for these child divisions will be different.