Solved

Reporting Services UTC Date conversion

Posted on 2008-10-15
5
1,222 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

690 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