View Single Post

   
  #2 (permalink)  
Old 02-29-2008, 08:30 PM
Hugo Kornelis
 
Posts: n/a
Default Re: How accurate is GetDate() ?

On 26 Sep 2006 11:28:07 -0700, jim_geissman@countrywide.com wrote:

>According to MS, GetLocalTime() (in C++) is only accurate to approx a
>second,
>even though it reports milliseconds, and calling it twice and computing
>the
>interval can on occasion lead to a negative interval.
>
>Is T-SQL's GetDate() more accurate than that, or at least
>non-decreasing?


Hi Jim,

Getdate() (or, to use the ANSI standard name, CURRENT_TIMESTAMP) is
accurate to 1/300th of a second. I've never seen it decrease. Apart from
that, it is as accurate as the system clock of the server - if an admin
sets the system clock three hours back, SQL Server will report from the
past.

--
Hugo Kornelis, SQL Server MVP
Reply With Quote