Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-04-10 : 17:22:24
|
| I am using Visual Studio 2008 to create reports from an Oracle database.Is there a way to have the report adjust for DST without having to go back in and change the query when DST changes. The reports have to go thru a validation process so it is not convienentt to have to change the query when DST changes.I am looking for just the Hour and minutes.I currently use the follow queryTO_CHAR(v.VISIT_DATETIME, 'HH24:MI:SS') Arrival_Time,But since we are in DST it is off by one hourThanks |
|
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-04-10 : 17:29:27
|
I think this would be hard to do for a number of reasons:a) depending on where you are (Arizona?) they may not be observing daylight savings;b) depending on the year, the date on which daylight savings time changed may change. (They changed the dates in 2007?)If you are looking just for the current time, rather than historical data stored in a table, you can compute the difference between UTC time and local time to find out how many hours to offset:DATEDIFF(hh,GETUTCDATE(),GETDATE()) |
 |
|
|
MikaSa
Starting Member
7 Posts |
Posted - 2012-04-10 : 18:08:13
|
| Unfortunately I am looking to retrieve the time stamp in the database. The time stamp displyas correctly in sql developer but that is an oracle product. The time just gets lost in translation.Do you think that it would be possible to pass the date as a parameter and have the parameter based on an iif statement. If this is possible I could set the statement for lets say 5 years forward and back and not have to worry about the validation process for a while. |
 |
|
|
|
|
|