You are here: Re: system time on sql server is wrong? « MsSQL Server « IT news, forums, messages
Re: system time on sql server is wrong?

Posted by Erland Sommarskog on 09/30/20 11:17

(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/techinfo/productdoc/2000/books.asp

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация