Sunday, March 25, 2012

Default dates to UTC in SQL Server 2000

Hi all,

I hope this is the correct forum. I have SQL Server 2000 installed on a server located in the USA. The local time zone on the server is EST. Therefore getdate() returns EST time. I now realise that I'd like to be saving all my timestamps in UTC. While I could modify all my stored procedures to use getutcdate() rather than getdate() I wonder if there is a database level setting for time zone that will cause getdate() to return UTC date?

Any ideas?

Des

Unfortunately, there is not a database or server lever 'switch' that would allow us to shift time zones.

However, it would be fairly quick to search syscomments for getdate() to determine a list of procedures needing alteration.

You would also want to change any table definitions where column level defaults are set to getdate().

Or, you could set the OS Server time for GMT timezone and turn automatic DST off -but that would effect all other non database logging on the server. Perhaps not a good idea...

|||

Thanks Arnie. I thought as much but it's always good to double check.

Regards,

Des

No comments:

Post a Comment