Hello,
I am new with the reporting services. I am creating a report and I need to display date/time on the report. But the servers stores those date/time in UTC. How can I convert them to the local time in my report.
Thanks for your help.
You need to use System.TimeZone.ToLocalTime(UTCTime).
See http://msdn2.microsoft.com/en-us/library/system.timezone.tolocaltime.aspx.
You should be able to use TimeZone.CurrentTimeZone if you want to convert using the server time zone.
|||Hello,
i tried this tip with no luck.
I used the expression = System.TimeZone.ToLocalTime(!Fields.DateTime.Value) in one of my cells and got an BC30469 error.
|||Try this instead:
=System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!DateTime.Value)
-- Robert
|||Robert,
thanks alot. Works like a charm.
|||This works for conversion based on the time zone of the report server, but not the client. Is that correct? I tested this by using the function in a textbox on the report that I deployed to the report server. Then on my workstation PC, I changed my timezone and viewed the report. The time in the report still reflected the time on the report server (converted from the UTC time of course).
How do you change the dates in the reports dynamically based on the area of the country someone opens the report? Because the report renders as HTML first before being delivered to the client, does this mean it will always use the report server time zone?
Thanks
-Kory
No comments:
Post a Comment