Environment: Product version LS11.4.2, TP version 12.4.3
Summary
Frontend JavaScript calls System.TimeZone.CurrentTimeZone.Id to retrieve the client time zone and passes it to the backend for Crystal Reports PDF generation. For some customers, after a certain point in time, the call begins returning an empty value instead of a valid time zone ID. This article records the reported behaviour, the explanation of how the time zone value is managed, and the diagnostic approach agreed with R&D.
Symptom
- System.TimeZone.CurrentTimeZone.Id returns an empty value rather than a valid time zone ID.
- Crystal Reports then reports an incorrect or missing time zone during PDF generation.
- The problem does not affect all users.
- It appears to be time-related, starting after a specific date or system update.
Queries
- Under what circumstances System.TimeZone.CurrentTimeZone.Id may return an empty value.
- Whether the behavior can be influenced by browser settings, OS time zone configuration, daylight saving changes, system patches, or framework/runtime updates.
- Whether there are known limitations or deprecations affecting this API in recent environments.
- Whether a more reliable alternative exists for obtaining the client time zone for Crystal Reports.
How the Time Zone Value Behaves
R&D clarified the lifecycle of the value:
- The time zone information is initialized when the browser tab is opened or refreshed. It is not re-evaluated continuously during the session.
- Once initialized, the ID itself cannot be changed.
- However, the containing object, System.TimeZone.CurrentTimeZone, can be changed by other code.
That distinction is the key to the diagnosis. An empty ID therefore points to one of two situations: either the ID was set to empty somewhere in the TP code, or the System.TimeZone.CurrentTimeZone object was overwritten entirely after initialization.
Because initialization happens only on tab open or refresh, long-lived sessions are more exposed to later interference, which is consistent with the reported pattern of the value working initially and then failing.
Diagnostic Procedure
R&D supplied an instrumented version of the JavaScript that initializes the time zone ID, with added alerts to make the failure point visible.
- Take the supplied JavaScript and paste it at the beginning of the HTML_Bootstrap client script. This is the code that initializes the time zone ID.
- Deploy the change.
- Inform users that once the time zone ID becomes empty, they will see a popup message when they attempt to view reports.
- Ask the affected user to capture two screenshots:
- the popup message, and
- the browser DevTools Console tab.
The combination of the popup and the Console output identifies whether the ID is being set to empty within the TP code, or whether the whole object is being overwritten.
Next Steps
Collect the screenshots from an affected user before proposing a code change. Until the failure point is identified, it is not possible to say whether the fix belongs in the TP code, in the initialization sequence, or in whatever component is replacing the object.
Key Points
- Time zone information is captured only when the browser tab is opened or refreshed.
- The ID is immutable once set, but System.TimeZone.CurrentTimeZone as an object is not protected from being replaced.
- An empty ID is therefore a symptom of either the ID being cleared in TP code or the object being overwritten.
- Diagnose with the instrumented HTML_Bootstrap script, and collect both the popup screenshot and the DevTools Console screenshot from affected users.
Comments
0 comments
Article is closed for comments.