Subscribe to Windows IT Pro
February 05, 2000 12:00 AM

How can I get the current time in GMT rather than local time?

Windows IT Pro
InstantDoc ID #14371
Rating: (0)

A. Use this code (courtesy of Microsoft PSS) :-

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


Related Content:

ARTICLE TOOLS

Comments
  • Rabih Filfili
    12 years ago
    Aug 30, 2000

    you can try to use
    select GETUTCDATE()
    -Thanks

You must log on before posting a comment.

Are you a new visitor? Register Here

advertisement

advertisement

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.