- Getting Started
- Administration Guide
- User Guide
- Developer Guide
Time Zone Setting
This section will cover the following scenarios for the time zone setting:
Transform the date to the specified time zone by using UserContext.ToUserTZ() function
You can transform the date to the specified time zone (set in the profile setting) by using UserContext.ToUserTZ() function from the expression editor under Miscellaneous.
Example: In this example, we will use the UserContext.ToUserTZ() function and update the date time field in the report according to the Time Zone set in the admin portal.
Create a report with a DateTime field. We have taken SaleDate as the date time field in this example.
Preview the report.
Click the Data Binding option and select the Expression option.
In the Expression Editor, add the following expression by selecting the UserContext.ToUserTZ() function under Miscellaneous and click Save.
Set the Time Zone in the user profile settings. In this example, we have selected (UTC-9.30) Marquesas Islands.
Now preview the report again. The report date time field SaleDate will be displayed according to the time zone settings.
Auto-generate calculated fields with user time zone
If the property Auto-generate calculated fields with user time-zone is set to True in the Report Designer Settings by the admin, then the calculated fields transformed to user time zone are auto-generated for Date and DateTime fields of embedded and Server datasets. The Time zone set for the user directly works on the calculated fields without using an expression.
Example: If on the Admin portal, the property Auto-generate calculated fields with user time-zone in the Report Designer Settings is set to True.
Then on the Report Designer, on binding the dataset, the new calculated fields are added in the dataset for date or datetime fields as shown below.