Time Service

The Time Service is responsible for setting the time zone and maintaining the system time on the STB. The service does not have a TOI interface but uses information objects. If the clock of the STB drifts from the time received from the source, the service will slowly adjust the time to avoid sudden changes which may affect applications and platform services in an unexpected way.

Time Sources

Currently there are four available time sources:

Time Source Configuration

To select time source, add one of following IIPs to your build configuration:

kreatv-option-ntp
kreatv-option-sntp
kreatv-option-timecast
kreatv-option-dvbtime

Note! Only one of the above IIPs could be added to build config file. Support for having more than one time source in a boot image may be added in future versions of KreaTV.

The Time Service will check the selected IIP and set the value of the information object const.time.available_sources. The value set is {ntp|sntp|timecast|dvb}.

Time Zone Configuration

It is possible to configure the timezone in build time by adding the "kreatv-option-tz:[time zone value]" in the build config file. The timezone can also be changed in run-time by updating the cfg.locale.timezone information object with a string of the same format. If the information object has not been set by the user, the time zone set at build time can be read from the object.

Time Zone String Format

The following is an example of a time zone string:

kreatv-option-tz:CET-1CEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00

There are two different flavors for the string format:

std offset
std offset[dst[offset][,start[/time],end[/time]]]

The first format is used when there is no DST (daylight savings time) for the country or region in question. The second format is used when a country or region has DST in place.

The format for each part of a time zone string is as follows:

Time Zone String Examples

Examples best describe the formats.

EST+5. Eastern Time Zone, five hours behind UTC time.

WST-10. Western Time Zone, ten hours ahead of UTC.

EST+5EDT,M4.1.0/2,M10.5.0/2. Eastern Time Zone, five hours behind UTC time. The DST time is Eastern Daylight Time which is applicable from the first Sunday in April at 2 AM and ends on the last Sunday i in October at 2 AM.

Time Service Behaviour

The Time Service is alone responsible for the entire time keeping. No application or other platform service should change the clock by calling system time functions. The Time Service handles the following information objects.