Home > Archive > Microsoft SQL Server forum > May 2005 > system time on sql server is wrong?









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author system time on sql server is wrong?
thomasamillergoogle@yahoo.com

2005-05-29, 11:23 am

Hello,
My sql server 2000 database is on a shared server that I have
absolutely no control over.

When i run query select getdate() it is reporting the wrong time!

I am pretty sure that the sql admin changed the date on the server last
night and now this is happening.

Is this possible. Shouldn't getdate() ALWAYS report back the date time
in my LOCAL time zone?

Erland Sommarskog

2005-05-29, 1:23 pm

(thomasamillergoogle
@yahoo.com) writes:
> My sql server 2000 database is on a shared server that I have
> absolutely no control over.
>
> When i run query select getdate() it is reporting the wrong time!
>
> I am pretty sure that the sql admin changed the date on the server last
> night and now this is happening.
>
> Is this possible. Shouldn't getdate() ALWAYS report back the date time
> in my LOCAL time zone?


No. getdate() will report the time in the server's time zone.

And as far as I know, getdate() follows the system time. That is, if system
time is adjusted, then getdate() follows suit.

If you have access to xp_cmdshell (since this is a shared server, I suspect
you have not), you can try:

exec master..xp_cmdshell 'time /T'

to view the system time without SQL Server in between.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com