Reply to Re: getdate() problem: where is the time taken from ?

Your name:

Reply:


Posted by Erland Sommarskog on 04/25/07 21:57

Matik (marzec@sauron.xo.pl) writes:
> there is a program running, which sends information to two other
> programs.
> This information is a timestamp of the program in datetime format,
> which has it's own clock.
> The clock is incremented each 5 seconds of the program, which
> corespondes to aprox. one second of the real time.
> It means, each on second of real time, the computer time is updated +5
> seconds.

So you have an application that modifies the computer clock every
second, and now you are asking why:

> What I can not UNDERSTAND, why sometimes the time is equal, or
> sometimes is ALMOST equal (within the diff of miliseconds), and why
> sometimes the time is like this(!!!) :
>
> getdate() = '2007.04.25 10:59:55.000'
> prm_recieved = '2007.04.25 10:00:00.000'

getdate() does not always reflect you recently updated system time.

I guess the answer is that there is not really reason that Windows and
SQL Server would behave the way you may want it to in this very special
scenario.

One reason that getdate() apparently lags behind is that getdate() has
a resolution of 3.33 ms which after all is quite a long time in a computer.
Assuming that SQL Server reads the system clock every 3.33 ms, getdate()
could seemingly lag behind your manipulated time.



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

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

[Back to original 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

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