Articles in this section
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.

  1. Create a new parameter and provide the time zone values required for conversion, as shown in the image below.

    image.png

  2. 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)

    image.png

  • 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.
  1. Click the Preview button to see the output, as shown in the image below.

    image.png

    image.png

    image.png

  2. Click here to download the sample report.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied