Subject Re: [firebird-support] windows system clock and fb server
Author Helen Borrie
At 11:56 16/10/2008, you wrote:
>i have FB1.5 running on windows 2k server sp4. Australia changed to
>daylight savings a couple of weeks ago and the windows system clock
>changed automatically. The FB server nor windows had been restarted
>. The software we have which uses BDE to connect to FB presumably used
>queries using the "NOW" or similar SQL keyword and have been getting
>the old time (one hour behind) despite the windows clock reading
>correctly.
>
>Can someone explain to me the relationship between the FBserver time
>and the windows system time and how frequently the two are synchronised

There is no relationship between Fb server time and Windows time. Fb server time is whatever the current BIOS clock time is.

When you change Windows time it's a lottery, whereby one of three things will happen at random:

1) Windows immediately makes a deep call to adjust the system clock. I don't *think* it has done this since Win98.

2) Windows writes the "Windows time" somewhere and synchronises the system clock at power down or reboot. I seem to be getting this behaviour on Win2K SP4.

3) Windows gives you the option of synchronising. I've been told this is what happens with XP and its relatives.

4) And there might be something else with Vista.

In short, Fb always reads the system clock, on all platforms, so it is amongst your "absolute need-to-knows" if running servers under Windows, to know how your particular installation will behave. Hence, it is a VERY good reason to peg time-dependent ops firmly to UTC time at the *SERVER*. It takes moments to set up with an on-line service. And *never* to use Delphi's Now() function for recording timestamps. Firebird gives you context variables and special time literals to get your various server-based times and dates.

Incidentally, eBay Australia is clearly having problems with our earlier-than-usual summertime. At Labour weekend they announced that their clocks would move into summertime on the Sunday morning (like yours and mine). But - at least until today - it is not fixed.

./heLen