SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Site Related Forums
 Article Discussion
 Article: Getting the time zone
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 07/16/2000 :  12:48:18  Show Profile  Visit AskSQLTeam's Homepage  Reply with Quote
Kristof writes "GETDATE() returns the current local date/time. There doesn't seem to be any function to get this in GMT time, or even find out what time zone the SQL server is running in. Assuming the client connects to the server with ODBC and doesn't know what timezone the server is running in, how can it find out? I know the client could subtract the clients time from the servers GETDATE(), but that would only work if the two machine's clocks are synchronized"

Article Link.

Anonymous
Starting Member

0 Posts

Posted - 09/14/2000 :  09:41:07  Show Profile  Reply with Quote
There is one more way to do what the person asked!

Hey, Guru, check this out

declare @deltaGMT int

exec master.dbo.xp_regread 'HKEY_LOCAL_MACHINE',
'SYSTEM\CurrentControlSet\Control\TimeZoneInformation',
'ActiveTimeBias', @DeltaGMT OUT

select getdate() as LocalTime, dateadd(minute, @deltaGMT, getdate() ) as GMT


Keith
kek@novusmkt.com

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.09 seconds. Powered By: Snitz Forums 2000