
In the world of server-based reporting, there are often challenges in connection with different time zones. The complexity increases in particular when the database server, the reporting server and the client are located in different time zones. This can lead to various problems:
- The Now() function usually refers to the server time and not to the client’s time zone.
- If no UTC times are stored in the database, the interpretation of the time information can be unclear.
- Timestamps from the database are often converted to server time, which results in the client receiving incorrect information.
To address these problems, we have introduced an innovative solution in List & Label: the new “TimeZoneInformation” property of the .NET component. This feature allows developers to specify a separate TimeZoneInfo instance for each client and database. With this important new feature, List & Label can correctly translate the timestamps from the database into server time and adapt them to the client’s time zone before passing them on to the client.
Implementation of TimeZoneInformation
A simple implementation example shows how to load the system time zones into a ComboBox and then set the selected time zone for the client:
// Load system time zones into a ComboBox ReadOnlyCollection<TimeZoneInfo> timeZones = TimeZoneInfo.GetSystemTimeZones(); foreach (TimeZoneInfo timeZone in timeZones) { comboSystemTimeZones.Items.Add(timeZone); } comboSystemTimeZones.SelectedIndex = comboSystemTimeZones.FindStringExact(TimeZoneInfo.Local.ToString()); // Set client time zone in List & Label LL.TimeZoneInformation.Client = comboSystemTimeZones.SelectedItem as TimeZoneInfo;
This new feature is particularly important for international applications or in cloud-based ecosystems where the correct time zone is critical for data accuracy. With TimeZoneInformation, List & Label ensures that all users receive accurate and relevant data in real time, regardless of their geographical location.