Link to home
Start Free TrialLog in
Avatar of RockHead
RockHead

asked on

Reporting Services UTC Date conversion

I have an sql 2005 database with several fields that need to be timezone agnostic.  Using nHibernate interceptors we have fixed the application side and everything is happy.  The problem is with our reports.

We are using SQL Reporting Services 2005, the reports reside on a server that lives in MST.  The users (most, but not all of them) reside in CST.  The times are stored in the DB in UTC.

So I am aware of using the following code:
System.TimeZone.CurrentTimeZone.ToLocalTime(Fields!ShipDate.Value) but this will only convert to server time.

The basic question: Is there a way to convert dates in the report either from UTC to the client's time or from MST to the client's time?  Ideally the solution would be something akin to the nHibernate Interceptors so I could convert the report dates from UTC on the client.
Avatar of MohammedU
MohammedU
Flag of United States of America image

Check the following article may help you...
http://articles.directorym.net/Stitching_Up_Time_Zones-a923861.html
Avatar of RockHead
RockHead

ASKER

So for the points, assuming that I pass in an arbitrary time zone to my SQL services report.  How can I use that information to actually convert the UTC datetime into that time zone based on the DST status of the datetime?
So the solution to the problem was actually to pass in the utc offset and the daylight saving times of the client machine into each report.  Then, using a custom assembly, convert the utc times based on the utc offset and daylight times passed into the reports.  This isn't as ideal as finding a way to intercept the report on it's way back to the client.  But it works relatively well.

Since I didn't end up using your resource as part of this answer, I'm going to have to ask for the points to be refunded.

Thanks,

David
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial