I have a report with date fields. I need to convert dates stored in data server in the time zone of user's machine where the report is run. The dates in data server are in GMT time zone. I am seeing report in
India and expecting the date to be shown in IST time zone (i.e. GMT + 5:30).
This is very typical requirement and I have found many references to achieve this. As per one of the references [http://stackoverflow.com/questions/2969689/working-with-time-zones-in-ssrs],
I have added following code in report page -
Shared Function FromUTC(ByVal d As Date, ByVal tz As String) As Date
Reporting Service doesn’t provide a function that can get the TimeZone of a Client machine. Hence, we have to create a parameter through which the client users can select his/her TimeZone, and then pass the parameter value to the custom function FromUTC
in the expressions.
In your scenario, the expression “=Code.FromUTC(Fields!UTCDateFromDatabase.Value,TimeZone.CurrentTimeZone.StandardName)” cannot achieve your goal. This is predictable because TimeZone.CurrentTimeZone.StandardName gets the TimeZone of Report Server side.
To achieve the goal, please refer to the steps as shown below:
1.Create a parameter named TimeZone, select Available value and click Specify values.
China Standard Time China Standard Time
2. Call the custom code and type the expression to convert the TimeZone as follows: