Time Zones

Characteristic

Short description

According the Coordinated Universal Time definition, the world is partitioned into diverse areas of more or less regular stripes, for which the same local time is used. In consequence, these time zones define the hours and minutes the local time is ahead or behind Greenwich Mean Time in this area. According to regional regulations, daylight saving time aplies for some different time spans. As a result, the UTC time offset depends on the geographical location and the time.

Use

Time relevant parameters are used in multiple situations, especially the TimeConsideration type. It incorporates a reference time to determine which time-dependent data should be taken into consideration to calculate the response.

Fields representing time-specific parameters in the PTV xServer API are expected to contain a UTC offset, mostly due to its uniqueness. If a time zone is missing, the service tries to determine the time zone by the context of the corresponding functionality. Below the behavior is described in detail.

Detailed Consideration

According the Coordinated Universal Time definition, the world is partitioned into diverse areas of more or less regular stripes, for which the same local time is used:

World map of current time zones | source: wikipedia

For an arbitrary coordinate on Earth the corresponding time zone can be determined. This time zone is represented by its offset to UTC or Greenwich Mean Time (GMT). Quite often the borders of such a time zone correspond to the borders of a country or state. In combination with more or less arbitrary regulations concerning daylight saving times, the determination of the UTC offset proves to be quite complex.

A point in time is always specified by a string in the format 2015-12-24T12:00:00+01:00 (which is December 24th, 2015 at 12:00 noon with an offset to UTC of +1 hour), related fields have the type XMLGregorianCalendar. This type does not require the UTC offset to be specified, but we strongly recommend to specify it always, in order to execute operations covering several time zones and to assign time-dependent information such as speed patterns correctly.

Handling Local Time

A point in time without a UTC offset is treated as local time. Although it is recommended to always specify a time zone, PTV xServer will automatically assign the UTC offset from the request context or throw an exception if it fails. In the following description the determination of the intended UTC offset for the planning horizon in an xTour request is used as an example. Since the planning horizon has no location, the other locations of the request are used to determine the UTC offset during the following steps:

This approach to determine the time zone can be applied generally, also when only one location is available, as in the case of an opening interval in the Site type. The (one and only) location of the tour's site can be used to detect the missing UTC offset.

Other examples for determination of a missing UTC offset are:

A special case is the map rendering. The behaviour of the automatic time zone detection is slightly different and described in the following example. In this example, the rendering is performed in combination with time-dependent Feature Layer properties, but a reference time without a time zone is specified. To determine the time zone most propably intended, the center of the map and its edges are used as an array of locations and applied to the following evaluation: