John A Grandy
2009-07-28 17:45:32 UTC
Transact-SQL Reference (SQL Server 2000)
GETUTCDATE
Returns the datetime value representing the current UTC time (Universal Time
Coordinate or Greenwich Mean Time). The current UTC time is derived from the
current local time and the time zone setting in the operating system of the
computer on which SQL Server is running.
I find this disconcerting for a few reasons.
1. what if current localtime is wrong ?
2. what if someone has temporarily changed the server's timezone ( perhaps
for debugging reasons ) causing columns with getutcdate() default to be
mis-populated ?
3. how to ensure Windows timezones DST-datetime-ranges are reliably updated
in a timely manner ?
But I suppose the other options cannot be assumed to exist , such as network
assumed and server syncs its utc time against a network timeserver , or inet
access assumed and server syncs against a inet timeserver ...
How is this problem commonly approached in production environments ?
GETUTCDATE
Returns the datetime value representing the current UTC time (Universal Time
Coordinate or Greenwich Mean Time). The current UTC time is derived from the
current local time and the time zone setting in the operating system of the
computer on which SQL Server is running.
I find this disconcerting for a few reasons.
1. what if current localtime is wrong ?
2. what if someone has temporarily changed the server's timezone ( perhaps
for debugging reasons ) causing columns with getutcdate() default to be
mis-populated ?
3. how to ensure Windows timezones DST-datetime-ranges are reliably updated
in a timely manner ?
But I suppose the other options cannot be assumed to exist , such as network
assumed and server syncs its utc time against a network timeserver , or inet
access assumed and server syncs against a inet timeserver ...
How is this problem commonly approached in production environments ?