Time Zone Provider

To obtain a correct local time in JavaScript Gameface needs to know about your time zone. The product has a default implementation that queries the OS for it, but since time zone correctness is either unnecessary or expensive you can provide your own implementation.

The Time Zone Provider interface resides in include/cohtml/ITimeZoneProvider.h.

To override the default code you have to implement the interface and pass an object to a View through the ViewSettings::TimezoneProvider initialization option.

Gameface calls methods of the interface when needed. The methods receive a UTC time point and are expected to return one of the following:

  • Time offset from the UTC zone.
  • Time offset for daylight savings time if it is in effect.
  • The name of the time zone that you are in.

For an example implementation you can check the Modules/TimeZoneProvider folder.