Microsoft Year 2000 Readiness Disclosure
& Resource Center |
|
|
|
Developing Year 2000 Compliant
Applications in Microsoft Visual Basic |
|
3. Introduction
Hands
upùhow many of you have heard of the Millennium
Bug or Year 2000 Problem or its other names
over the last few years? If any of you didnÆt raise a hand, either
you are not open to suggestion or you are new to this planet.
Welcome! We call it Earth.
Much has
been written about this subject over the past few years. Although
there is a great wealth of information, much is aimed at the COBOL
community. What isnÆt tends to be genericùlimited to management
guides and theoretical discussions. In this paper, I will look at
the issue from a practical perspective, focusing on the particular
relevance to Microsoft« Visual Basic« development systems. I
will look at the way Visual Basic stores and manipulates date
information and will reveal its weaknesses, which are equally
important.
For me,
the issue is not so much what happens when the clocks strike
midnight on a certain night in December 1999. The issue is that many
developers still do not fully understand how our language deals with
this simple piece of data!
A
Little About the Date Rules
The
Gregorian calendar, which is used throughout the Western world, has
a long and checkered past. It was first introduced in 1582 by Pope
Gregory XIII, after whom it is named.
Prior to
the Gregorian calendar, the Julian calendar was widely used. The
Julian calendar had a leap year every four years. Because the actual
period of EarthÆs orbit around the sun is 365.24219 days, there was
a slow shifting of the seasons. Until the sixteenth century, events
such as the autumnal equinox were occurring up to 10 days earlier
than they were when the Julian calendar was introduced. The
Gregorian calendar changed the rule for the century years, so they
would not be leap years unless they were divisible by 400.
The new
calendar was adopted in Catholic countries in 1582. Ten days were
dropped to bring the seasons back into line. October 4 was
immediately followed by October 15, with no dates in between. The
United Kingdom and its colonies made the change in 1752ùdropping 11
days (September 2 was immediately followed by September 14).
Note Every fourth year is a leap
year except years that are also divisible by 100. However, years
that are divisible by 400 are leap years. So the year 2000 is a leap
year and 1900 and 2100 are not.
|