• subscribe
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

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




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