Class TimeZoneInformation
- Namespace
- combit.Reporting
- Assembly
- combit.ListLabel31.CrossPlatform.dll
Holds the time zone configuration that should be applied while processing data and evaluating expressions.
public sealed class TimeZoneInformation
- Inheritance
-
TimeZoneInformation
- Inherited Members
Examples
// Suppose you have a database in Eastern Standard Time (US), an app server running elsewhere,
// and clients scattered across various time zones (e.g., in Central Europe).
ll.TimeZoneInformation.Database = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time");
ll.TimeZoneInformation.Client = TimeZoneInfo.FindSystemTimeZoneById("Central European Standard Time");
// Now, when the report uses date expressions or reads datetime values from the database,
// the engine can convert from database time -> UTC -> client time,
// so the output reflects the client's local time.
Remarks
This class is used to address discrepancies that arise when your database server, app server, and client are in different time zones. In particular:
- The
Now()function (and all other date-related functions) in reports, by default, return timestamps in the app server's time zone—not the client's. - If date/time values in the database are not stored in UTC, interpreting them without knowing the database's time zone can lead to incorrect conversions.
- When the app server and client are in different time zones, timestamps fetched from the database may need adjustment so that the client sees the correct local time.
The TimeZoneInformation feature enables specifying separate TimeZoneInfo instances
for the database and for the client. The report can then convert database times into
an intermediate time zone (typically UTC), and finally into the client’s time zone just before rendering or output.
Properties
Client
Gets or sets the time zone that represents the client requesting the report.
public TimeZoneInfo? Client { get; set; }
Property Value
Remarks
If this is non-null, report output or expressions involving current time will be adjusted so they appear to the client in its local time zone.
Database
Gets or sets the time zone that represents the database values.
public TimeZoneInfo? Database { get; set; }
Property Value
Remarks
If this is non-null, it is used to interpret raw date/time values from the data source.