June 26, 2008 at 6:07 pm
Heh... no problem... if you think no coffee is bad, I'm trying to quit smoking... got anyone you want to take to a porkchop dinner? π
--Jeff Moden
Change is inevitable... Change for the better is not.
June 27, 2008 at 4:56 am
Jeff Moden (6/26/2008)
Heh... no problem... if you think no coffee is bad, I'm trying to quit smoking... got anyone you want to take to a porkchop dinner? π
Ahah that explains it, noticed something a little unusual about some of your recent posts :hehe: Good luck
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
June 27, 2008 at 7:03 am
Chris Morris (6/27/2008)
Jeff Moden (6/26/2008)
Heh... no problem... if you think no coffee is bad, I'm trying to quit smoking... got anyone you want to take to a porkchop dinner? πAhah that explains it, noticed something a little unusual about some of your recent posts :hehe: Good luck
Ummm, yeah... I know what you're talking about... it's not just the trying to quit smoking... there's some real stupid stuff going on a work and when I see that same stupid attitude on this forum, I tend to get a bit snappy about it. I appologize if it makes some of the good folks, like yourself, uncomfortable in any way...
--Jeff Moden
Change is inevitable... Change for the better is not.
June 27, 2008 at 7:49 am
Jeff Moden (6/26/2008)
is250sp (6/26/2008)
I am a visual person. Would you mind showing me examples of how I would incorporate this into the script above?Ummm... sure... here's the original script that Carl made...
select cast('2007-11-19 15:29:00' as datetime ) as ExpectedTs
, dateadd(ss,1195507770, cast('1970-01-01' as datetime )) - (6.0 / 24 ) as CalculatedTs
... you would make a simple substitution... the - (6.0 / 24 ) would be replaced by the forumula I gave...
select cast('2007-11-19 15:29:00' as datetime ) as ExpectedTs
, dateadd(ss,1195507770, cast('1970-01-01' as datetime )) + (GETDATE()-GETUTCDATE() ) as CalculatedTs
Like I said and like Segiy just said... there is another factor that you have to in here... you have to add in when daylight savings time occurs and subtract (I think) an hour when DST kicks in not only for GETDATE(), but for when the date itself occurs.
If you are looking for a way to convert date/times to different time zones using SQL check out this link:
July 1, 2008 at 8:32 am
I contacted the vendor to inquire on how the app is converting the seconds to datetime and his response is.....
The app doesnt recognize if it is daylight savings or not, it checks with the system date and time. So if the system time is set to daylight savings then the app also converts the date to daylight savings.
Is there a way to do this in SQL?
Viewing 5 posts - 16 through 19 (of 19 total)
You must be logged in to reply to this topic. Login to reply