Category / Section
Converting Local Time Zone to Preferred Time Zone Using Parameter Values
Published:
Updated:
Bold Reports allows users to customize reports based on their preferred time zone for better analysis and understanding. Using expressions, you can convert the local server time zone into the user’s preferred time zone. This article provides guidance on achieving this using expressions within Bold Reports.
-
Create a new parameter and provide the time zone values required for conversion, as shown in the image below.
-
In the text box of the report, use the following expression as shown in the image below.
Expression: =System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId(Now(), TimeZoneInfo.Local.Id, Parameters!TimeZone.Value)
- System.TimeZoneInfo.ConvertTimeBySystemTimeZoneId: This function converts a time from one time zone to another based on the provided time zone identifiers.
- Now(): This function returns the current date and time.
- TimeZoneInfo.Local.Id: Retrieves the identifier of the local time zone.
- Parameters!TimeZone.Value: Refers to the parameter containing the preferred time zone value chosen by the user.