Two time-of-day clocks reside in every IBM-compatible computer. These clocks go by
several different names, but for simplicity, we'll call them the software and hardware
clocks. The software clock runs only when the computer is turned on. It stops when the
computer is turned off. The hardware clock uses a battery and runs even while the computer
is turned off.
Every computer that runs DOS or Windows has a built-in software clock within the
operating system. On old PC or XT-compatibles, this clock was driven by the Intel 8253
timer-counter chip or an equivalent device. AT-compatible computers use a device
equivalent to an Intel 8254 timer-counter. The timer-counter is programmed by the BIOS to
generate an interrupt every 54.936 milliseconds, or about 18.206 times per second. Another
BIOS routine counts the interrupt requests and generates a time-of-day clock that can be
read or set by other software programs. For example, Windows uses the information from the
software clock when it date and time stamps files.
The software clock is useful, but it has several limitations. First, the software clock
is a poor timekeeper. Its accuracy is limited by the stability of the interrupt requests.
Any change in the interrupt request rate causes the clock to gain or lose time. If you
leave your computer turned on for long periods, the software clock might be off by large
amounts, perhaps a minute or more for every day that the computer was left turned on. It's
also possible for an ill-behaved software program to use the timer-counter for another
purpose and change its interrupt rate. This could cause the clock to rapidly gain or lose
Another problem with the software clock is that it cannot display all possible
time-of-day values. The resolution of the clock is limited to the interval between
interrupts, or about 55 milliseconds as stated earlier. Only times that are even multiples
of this interval can be displayed. For example, 00:00:01.00 could never be displayed by
the software clock. The closest possible values it can display are 00:00:00.98 and
The single biggest limitation of the software clock, however, is that when the computer
is turned off the clock stops running. On the original IBM-PC, this meant that you
manually had to set the clock each time you turned the computer on. You could purchase an
optional battery-backed clock for the PC, but there were several different standards, and
not all of them worked with all software packages. This problem was addressed with the
introduction of the IBM-AT in 1984, which included a battery-backed hardware clock as
standard equipment. An AT-compatible hardware clock is included with every 'WinTel'
computer produced today.
The hardware clock is based on the Motorola 146818 Real Time Clock Chip, or a
functionally equivalent device. The clock is supported by the BIOS, and BIOS
services are available that let software programs read and set the clock.
The hardware clock is a CMOS device that consumes very little power. When the computer
is turned off, it runs on batteries. When the computer is turned back on, the software
clock starts running again and sets itself (within 1 second) to the hardware clock.
Although the two clocks are synchronized at start-up, they may run at very different rates
and will probably gain or lose time relative to each other while the computer is running.
The hardware clock is updated once per second and cannot display fractions of a second.
For this reason, it cannot be read or set within better than a second. The accuracy of the
hardware clock is determined by the quality of its timebase oscillator (typically a 32.768
kHz crystal). These crystals are economical, costing less than $1 in single quantities.
However, they offer only marginal timekeeping performance. They are sensitive to
temperature and other factors and are often not calibrated at the factory. Even under the
best conditions, these oscillators are not likely to be stable to better than 1 part per
million (about 0.1 seconds per day). In actual operation, most hardware clocks seem to
gain or lose time at a rate of about 1 to 15 seconds per day, with 5 or 6 seconds per day
being typical. Although the hardware clock usually outperforms the software clock by a
considerable amount, its performance often pales in comparison to even a low-cost
As you can tell by now, neither the software nor hardware clock is suitable for accurate
timekeeping. Fortunately, however, there are several ways you can keep accurate time on
your PC if your application demands it.
Back to top of
and Software Time Keeping Levels in a PC
The following discusses how
a PC keeps time and the ways you can improve on it.
The Basic PC Clocking Model
Timekeeping is done at several points
within the modern PC. The motherboard contains an on-board clock maintained and accessed
by the BIOS, the board level operating system. The BIOS clock keeps time and is read
by the operating system at boot time. Application software that uses time and dates
accesses the operating system clock. The advantages of this system are simplicity in its
straightforward approach; the major disadvantages are the poor time keeping ability on the
BIOS level and the vulnerability of the operating system clock to be thrown off by
demanding software or hardware.
Improving on the basic model
the internal clock to an external time standard provides an excellent way to maintain the
internal clocks at the correct time. Beagle Software's ClockWatch program monitors the PC
clock and accesses the Atomic Clock when desired or necessary.
||ClockWatch coordinates time settings connecting with an external time
standard. It sets both the operating system and BIOS level clocks.
National Institute of Standards and Technology maintains a precision time source based on
radioactive isotopes. It is accessible over the Internet or by direct connection via
Internal Time Synchronization
checking an internal timekeeper keeps the PC clocks at a more stable and predictable
time setting. ClockWatch provides a means to synchronize the operating system on a
||Beagle Software's ClockCard provides an
adjunct, stable Real Time Clock
based on a crystal oscillator. Every time the system is booted or the operating system
makes a BIOS time request, the ClockCard intercepts the request and returns the more
||On win 95/98 Systems, ClockWatch checks ClockCard periodically to update the
operating system clock - on Windows NT systems the checking is done by the operating
system every hour.
The Two-Tiered Approach to precision time keeping
Combining the Internal and External
approaches yields a powerful two-tiered approach to time synchronization. ClockCard
provides a stable clock to be used for frequent time checks. The external time source
provides a definitive time source and is used to set the entire system at standard time.
This approach provides the most comprehensive approach to precision time keeping.
Back to top of page
PCs and the Year 2000 Problem
We've all heard about the Year 2000
problem and that it will cause problems with PCs. Just how does it effect PCs, and more
specifically what can you do to prevent this from being a problem for your organization?
Below is a discussion based on a White paper by Karl Feilder, of Greenwich Mean
Time, an authority on Y2K problems.
Five-Layered Approach to the Year 2000 PC Issue
We can model the interaction between the hardware and software of a PC as a five-layered
'sandwich' - each layer representing a type of hardware or software activity. The most
important thing to understand about the Y2K problem is that it occurs across all five
layers of the PC.
Each layer is
potentially affected by the Year 2000 PC problem, which increases in complexity as it
progresses from 1 to 5. So the BIOS (hardware) layer is more quickly and easily resolved
than the data sharing layer. Since each layer is built upon the other it is especially
important that the lower layers (hardware and O/S) are correct.
1. Computer Hardware Layer (BIOS)
The BIOS (basic input/output system) initializes every PC on start up and passes date and
time information to the operating system and other software programs. The BIOS in each PC
sets up the system date and time by readingand automatically correctingthe
time in the battery-powered clock chip in the PC. If the BIOS date and time are wrong (and
new BIOSs can be affected, even now), the data generated by accounting, spreadsheet,
inventory, scheduling and payroll software programs cant be trusted.
- Locate and audit PCs.
- Assess hardware status.
- Fix BIOSs.
- Repair or replace BIOSs that can't be fixed.
Audit the PC's it is running on -
performing checks several times a day. It will highlight issues that occur in the BIOS,
fixing small errors and alerting you to larger errors.
2. Computer Operating
The operating system is sometimes responsible for feeding information to the other layers,
so it is critical that it operates correctly. The standard installation of most common
operating systems (including newer operating systems) is not optimized for 2000, which
puts successive layers at risk.
- Discover what operating systems are in use and where.
- Reconfigure to operate correctly.
- Upgrade/replace those operating systems that can't be corrected.
Monitor for problems that may crop up in
the operating system, correcting the minor problems and alerting you to major problems.
3. Software Programs Layer
Every software program treats data a little differently. Independent research shows that
64% of PC software programs exhibit potential Year 2000 problems in normal usage mode.
This research has also identified no less than 73 shades of gray at this
layer. For instance, software programs may be forced to guess the century when the user
enters only the last two digits of the yearand each software program may guess a
different century. Assumptions made by software programs are generally not obvious to the
- Identify what software programs are running within the organization and where they
- Find all custom software installed on the PC.
- Identify mission-critical software programs.
- Understand what risks they pose to your business if they can't operate correctly
- Repair, patch, replace or upgrade.
4. User File (Data) Layer
Data is fed into a PC, where it is turned into information. If the data includes dates, a
problem arises because most PCs cannot allow dates to span a century; years are entered as
two digits (YY), yet most PC programs calculate in four-digit years (CCYY). Most programs
automatically expand YY dates to CCYY dates, making a variety of century assumptions. Data
is thus often turned into incorrect information, but this is not apparent to the user who
doesnt know what century the program is assuming. The key is to focus on mission-critical systems and data so the business can continue operating through 2000 and beyond.
- Discover how many files exist in the organization.
- Pinpoint where they reside and how old they are.
- Establish how theyre affected by the Year 2000 problem.
- Define their role in the organization.
- Prioritize what files need to be repaired first.
- Repair data so it can be used in 2000.
5. User Data Sharing Layer
PC users constantly share data via disk, e-mail, the Internet, EDI, across networks, and
even when users "cut and paste" or "drag and drop." When data is
shared between one programor PCand another, it might be modified during the
transition. This is a bit like spreading a virus. In most cases it happens unknowingly and
goes unnoticed. Problems that occur at all of the other layers are compounded when data is
- Identify data sharing points.
- Limit exposure to non-compliant data.
- Keep existing data clean.
Back to top of page
Time Losses in
System Clock on Windows 95-Based Computers
The system clock on
a Windows 95-based computer may experience a cumulative loss of time.
When you run the Date/Time tool in Control Panel, the computer's real-time clock (RTC)
is updated using the MS-DOS system time. Because the RTC is being updated by a device that
is less accurate, a cumulative loss of time can occur over a period of time.
The MS-DOS system time is accurate to 1/18 of a second. Each time you use the Date/Time
tool, an incorrect time is written to the computer's RTC. The amount of time lost depends
on how often the Date/Time tool is opened and the amount of time since it was last opened.
For standalone computers, this may not be much of a problem. However, with network
programs that rely upon time and date stamps to ensure the proper file is accessed, this
can cause problems over a period of time.
Synopsis of Microsoft Knowledge Base Article ID: Q157619
Back to top of page
System Clock in Windows NT Can Lose
About One Second per Hour
If the time is continuously read on an x86-based Windows NT 3.1 machine,
the system appears to lose a second each hour.
The Real Time Clock (RTC) in x86-based computers has a resolution of one second.
Therefore, the Hardware Abstraction Layer (HAL) on x86 platforms uses an interval timer to
increase the resolution of the system clock into the millisecond range. Windows NT's
calculation of real time based on this interval timer is inaccurate enough that it could
get out of sync by over a second every hour.
Synopsis of Microsoft Knowledge Base Article ID: Q106434
Back to top of
PC Real Time Clocks - Dependence on BIOS and Power
Every PC contains a Real Time Clock (RTC) implemented in the hardware.
This clock runs continuously and provides time to the operating system clock when the
computer is booted. The RTC runs off the same power source as the system BIOS.
The System BIOS has information saved in a little piece (64 bytes) of CMOS RAM . The
CMOS power is supplied by a small battery, so its contents will not be lost after the PC
is turned off. Therefore, there is a battery and a small RAM memory on board, which should
never lose its information. The memory was in earlier times a part of the clock
it's part of a highly integrated circuit . CMOS technology needs little power so the
computer's battery is not in use much. Actually, there is not a battery on new boards,
but an accumulator (Ni-Cad in most cases). It is recharged every time the computer is
turned on. Some new motherboards have a technology called Dallas Nov-Ram
having an on-board battery as there is a 10 year lithium cell epoxyed directly in the
If your BIOS is powered by external batteries, be sure that they are in
good operating condition. Also, be sure that they do not leak - that may damage the
motherboard and cause your BIOS to suddenly "forget" its configuration (and
its time) and you may be looking for a problem elsewhere.
Back to top of
Computer BIOS and Windows NT Daylight Savings Time
Some system BIOS adjust the computers built-in real-time clock to
compensate for daylight savings time automatically. Windows NT 3.5 can also be configured
to adjust for daylight savings time. If both the BIOS and Windows NT adjust the close for
daylight savings time, your clock will be one hour off.
Windows NT updates its internal date and time every hour by reading the CMOS on the
motherboard. In-between the one hour intervals, Windows NT increments its own clock
approximately every 10 milliseconds. Because Windows NT cannot detect when the system
BIOS/CMOS (hardware level) adjusts the clock for daylight savings time, it may change the
clock by one hour, just as the BIOS does. This causes your computer clock to be one hour
ahead in the Spring or one hour behind in the Fall after both your computer's BIOS and
Windows NT adjust the clock for daylight savings time.
If you boot your computer under both Windows 95 and Windows NT, both operating systems
will adjust for daylight savings time independently, also causing the clock to be off by
Synopsis of Microsoft Knowledge Base Article ID: Q139452
See also Knowledge Base article: Q129574, Time Stamp Changes with Daylight Savings.
Back to top of
Applications Cause Time Loss in Windows 98
This information applies to Microsoft Windows 95/98 & Microsoft
Windows 98 Second Edition.
- When you first turn your computer on, the time as shown in the taskbar
clock is correct.
- After you leave your computer on for an extended amount of time, the time
may lose from two minutes up to an hour per day.
- You configure your computer to use third-party anti-virus, system utility,
and screen saver programs.
Disable the following types of third-party programs and utilities:
- Screen savers
- System utilities
Microsoft has confirmed this to be a problem in the Microsoft products listed
at the beginning of this article.
The CMOS does keep the correct time, and if you restart the computer the
Windows clock is updated. Also, if you start your computer in Safe Mode, Windows
does not lose time.
NOTE: This problem does not affect the clock in your computer's CMOS.
Synopsis of Microsoft Knowledge
Base Article Q189706
Back to top of page
Clock on Taskbar and in
Date/Time Tool Loses Time in Windows 95/98
The clock on the taskbar and in the Date/Time tool in Control Panel may experience a
loss of time.
This problem can occur for either of the following reasons:
- You change the year in the Date/Time
tool. When you click a different year in the Date/Time Properties dialog box, the clock
stops. When you click Apply or OK, the clock starts again, but it does not compensate for
the length of time it was stopped.
- You change the month or date in the
Date/Time tool. When you click a different month or date in the Date/Time Properties
dialog box, the current time is decreased by 5 to 10 seconds. Over time, this can result
in a significant time loss. This problem does not affect the clock in your
- Your computer battery is weak.
- Your CMOS computer clock is
To determine if the time loss is a result of a weak computer battery, follow these
- Click Start, point to Programs, and then click MS-DOS Prompt.
- At the command prompt, type "time" (without quotation marks), and then press
- Compare this time with the time reported by the clock on the taskbar.
- Type "exit" (without quotation marks), and then press ENTER.
If the computer's time and time on the clock are not the same, your computer's battery
may be too weak to keep accurate time, and it should be replaced. For information about
how to replace your computer's battery, refer to the documentation included with your
Synopsis of Microsoft Knowledge
Base Article Q189706
(August 24, 1998)
Back to top of page
ClockWatch - time sync software