What are time zone-dependent attributes?

Time zone-dependent attributes are attributes that take the current time zone into account when they are displayed. The values of the attributes are adjusted depending on the time zone in which they are displayed.

Time-zone dependent attributes are:

Storing

In the database, these attributes are stored in Greenwich Mean Time (GMT + 0). When the attributes are displayed to users in the attribute editor, designer, model viewer, etc., they are first converted to the client's local time.

When the values are changed by a user in his local client time zone, the values are internally converted to GMT + 0 and stored in the database.

Reports

When a report is started from a client, the client's time zone is transferred to the server. The server converts the time zone-dependent attributes when creating the output.

When a report is run as a scheduled report, no client information is available and no conversion can be performed. Therefore, the time zone-dependent attribute is displayed as if the server were in the GMT + 0 time zone.

Report script API

You should always use the methods accepting a string as parameter to change the value of time attributes. Example:

oDef.Attribute(Constants.AT_SAP_TIME_GEN, 0).setValue("07:12:45;11/19/2018");

Recommendation

We recommend not using java.util.Date, especially the setValue() methods, which accept a Date object as parameter: most of the various constructors of Date perform automatic conversion depending on the client's time zone. The conversion of a date into a character string, for example, via toString(), also performs a conversion into the client's time zone.

Example

This example assumes that both users are accessing the same server.

A user in Germany creates an object on Nov. 19 2018 4:12PM. (Based on his operating system local, the creation time is displayed as 19.11.2018 16:12.) If another user located in San Francisco looks at the Time of generation attribute, the value is not Nov. 19 2018 4:12PM, but Nov. 19 2018 7:12AM, because San Francisco is 9 hours behind German time.