Solved

Reporting Services UTC Date conversion

Posted on 2008-10-15
5
1,167 Views
Last Modified: 2012-05-05
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.
0
Comment
Question by:RockHead
  • 2
5 Comments
 
LVL 15

Expert Comment

by:MohammedU
Comment Utility
Check the following article may help you...
http://articles.directorym.net/Stitching_Up_Time_Zones-a923861.html
0
 
LVL 3

Author Comment

by:RockHead
Comment Utility
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?
0
 
LVL 3

Author Comment

by:RockHead
Comment Utility
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
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

How to increase the row limit in Jasper Server.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now