Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reporting Services UTC Date conversion

Posted on 2008-10-15
5
Medium Priority
?
1,257 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 15

Expert Comment

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

Author Comment

by:RockHead
ID: 22735360
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
ID: 22744019
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
ID: 22967559
PAQed with points refunded (500)

Computer101
EE Admin
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.

610 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