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 |
|
dzach
Starting Member
38 Posts |
Posted - 2008-12-10 : 11:30:25
|
| I have a SQL database that stores one of the time fields as seconds (I think), and looks like this: 1228893733. I have a query that converts the SQL time to regular date/time, but it's off by one hour (trying to convert to MST). Here's my query:Select DateAdd(ss, LastOccurTime, '1969-12-31T18:00:00.000') as OccurTimeFrom EventSuggestions on how to fix are appreciated!ThanksDale |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-12-10 : 11:45:38
|
| [code]Select DateAdd(ss, LastOccurTime-3600, '1969-12-31T18:00:00.000') as OccurTimeFrom Event[/code]or[code]Select DateAdd(ss, LastOccurTime-3600, '1969-12-31T18:00:00.000') as OccurTimeFrom Event[/code]..depending on whether you are ahead or behind. |
 |
|
|
sakets_2000
Master Smack Fu Yak Hacker
1472 Posts |
Posted - 2008-12-10 : 11:46:31
|
| add 3600 to the 2nd query. |
 |
|
|
dzach
Starting Member
38 Posts |
Posted - 2008-12-10 : 12:00:01
|
| Thanks! |
 |
|
|
hanbingl
Aged Yak Warrior
652 Posts |
Posted - 2008-12-10 : 12:06:06
|
| its confusing when you don't specify the correct answer. Ist supposed to be 2008-12-10 1:22:13 or 00:22:13?? Why start with 1969-12-31 6pm? |
 |
|
|
|
|
|