Discussion Locked

Greenwich Mean Time in SQL Server 7.0

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Has anyone figued out how to return Universal Time Coordinate or Greenwich Mean Time for use in SQL Server 7.0 T-SQL code?

The GETUTCDATE() function does this in SQL Server 2000, but I have been unable to find the equivalent in 7.0.

1 reply

by -oj

you can use undoc xp for this:

declare @GMT int
exec master..xp_regread 'HKEY_LOCAL_MACHINE',
'SYSTEM\CurrentControlSet\Control\TimeZoneInformation',
'ActiveTimeBias', @GMT OUT
select dateadd(minute, @GMT, getdate() ) as GMT

This discussion is closed to new replies.