Calendars, Time & Bugs: Y2K, Y2004, Y2038, Y2106, Y4K

y2k20 - a potential crisis in 2020

Modern browsers in 2020 will expect to "connect HTTPS" only using TLSv1.2 and TLSv1.3 (this assumes that support for everything from SSLv3 up to and including TLSv1.1 will be removed)

comment: Firefox has been warning for several months (today is 2019-08-25) that one of my servers is preferentially offering connections via TLS-1.0 (the lock icon is closed but is orange). Chrome and IE11 each present a green lock icon.

Overview: comparing y2k to y2k20

Y2K (in the year 2000 ) was a problem related to old technology (both hardware and software) where it was not certain if internal clocks would know how to handle these two problems: would clocks properly roll over from 1999 to 2000 or would they wrap back to 1900? would the year 2000 be a leap year or not? (it was a leap year according to rule-3) notice that these human-caused problems where caused by: a lack of coordination in the computer industry (caused by companies competing with each other rather than working together) businesses and governments refusing to upgrade egotistic programmers doing their own thing rather than calling the operating system

(in the year ) was a problem related to old technology (both hardware and software) where it was not certain if internal clocks would know how to handle these two problems: Y2k20 (in the year 2020 ) is a potential problem where: security changes in client browsers (which are usually auto-upgraded) may not be able to communicate with web servers (which are not auto-upgraded) this is a client-server problem security changes in web servers (depending upon how they are implemented) may not accept connections from customers unwilling or unable to update this is a B2B (business to business) problem where third party software (usually linked to older OpenSSL libraries) is used to initiate a web connection.

(in the year ) is a potential problem where:

Why is 2020 going to be a problem?

y2k was (perhaps) so overblown that many people assumed that a whole lot of money had been spent but nothing happened. This assumption is faulty because the problem was largely averted

was (perhaps) so overblown that many people assumed that a whole lot of money had been spent but nothing happened. This assumption is faulty because the problem was largely averted y2k20 does not appear to be taken seriously by anyone back during Y2K, not very many people relied on browsers twenty years later, almost everyone relies upon browsers for something email clients have gone the way of the dodo (Microsoft will not allow you to install Windows Mail on a new Windows-10 platform); most companies tell you to read mail using a browser many people uses browsers for online banking; online investing; online purchases; online entertainment (eg. youtube) programmers aside, anyone who used a terminal emulator back in 2000 will most likely be using a browser today. to save money, many companies are not patching internal web-servers which are only accessed by internal employees on their internal intranets. But their employees are still agreeing to upgrade their own browsers. Kaboom!

does not appear to be taken seriously by anyone Don't think this will affect you? An unexpected change to OpenSSL in CentOS-7.3 on January of 2018 broke some things for me as I have documented here

Good News from Microsoft

There are a lot of desktops in the world still running Windows-7 and those users were either unwilling or unable to upgrade to Windows-10

Windows-10 was rolled out with two browsers, IE11 (Internet Explorer 11) and Microsoft Edge . Customers were instructed to begin using the new browser but many refused

and . Customers were instructed to begin using the new browser but many refused Microsoft Edge was not available on older platforms which left those Windows desktops exposed to security exploits (appeared to be happening daily if not weekly)

was not available on older platforms which left those Windows desktops exposed to security exploits (appeared to be happening daily if not weekly) Since the customer adoption of Microsoft Edge wasn't successful, in 2019 Microsoft decided to partner with Google by replacing Microsoft Edge with a newer variation called Microsoft Chrome Edge . Google's Chrome browser is based upon similar technology Microsoft Edge version numbers run from 12 to 18 (EDGE-12 to EDGE-18) Microsoft Chrome Edge is currently at version 80 ( comment: Windows users should update to this browser ASAP)

. This new variation was only available to WIndows-10 users but it needed to be downloaded manually (was never part of an automated patch kit). This is still the case on 2020-04-10

In 2020-02-xx Microsoft announced that Microsoft Chrome Edge would be available to older platforms, including Windows-7, even though that OS is no longer officially supported by them (Kudos to Microsoft for doing the right thing) Download link for Chrome Edge (Windows 7-10): https://www.microsoft.com/en-us/edge

Microsoft announced that Microsoft Chrome Edge would be available to older platforms, including Windows-7, even though that OS is no longer officially supported by them (Kudos to Microsoft for doing the right thing) comment: we have got to convince people (friends, family, employers, customers) to abandon IE11 as soon as possible because it is holding back evolution of the internet. IE11 is the only popular-use browser that does not properly implement HTML5 (see: https://html5test.com/compare/browser/ie-11/firefox-60/chrome-68.html ) IE11 is the only popular-use browser that does not support JavaScript-1.6 (a.k.a. ECMAScript-6 or ECMAScript-2015) see: https://www.w3schools.com/js/js_versions.asp IE11 is the only popular-use browser that does not support Angular2 or higher (see: https://angular.io/guide/browser-support ) IE11 is the only popular-use browser that does not support jQuery2 (see: https://jquery.com/browser-support/ )

we have got to convince people (friends, family, employers, customers) to abandon IE11 as soon as possible because it is holding back evolution of the internet.

Additional news

2020-07-02 https://www.zdnet.com/article/mozilla-halts-firefox-78-rollout-and-then-restarts-it-after-fixing-this-search-engine-bug/

note: Firefox-74 was supposed to be released in March without default support for legacy protocols "TLS 1.0" and "TLS 1.1" but COVID-19 (amongst other things) changed that. Firefox-78.0.1 began downloading July-2 and only offers TLS-1.2 and TLS-1.3 (if your initial connection fails, just follow the prompts to re-enable lower protocols because this is just a warning for now )

2020-08-20 Two different people told me today that a recent Windows-10 update just killed their " Windows Live Mail " client. (I have not seen anyone else on the internet crabbing about this - yet) Like IE11, Microsoft no longer supports the Windows Live Mail client (IIRC, the last version came out in 2012; if it was on Window-7 when you updated to Windows-10 then you were allowed to keep it; you were not allowed to install it onto a new version of Windows-10) Non-Microsoft software, like Mozilla Firefox and Google Chrome, had the SSL and TLS protocols built into their stand-alone programs. Microsoft software (at least the stuff published ten years ago and older) relied heavily upon a large number of DLL files which were shared by many Microsoft applications in the Windows ecosystem.

SPECULATION: it is entirely possible that the latest Windows-10 update deleted DLL files required by the "Windows Live Mail" client. Those people will either need to get a third-party email reader (here are two: thunderbird and emclient ) or sign up for an annual Microsoft subscription to Office 365 (in this new marketing paradigm, software will be rented rather than purchased)



UTC (Universal Time Coordinated)

Before the age of internet connectivity, most non-military computers were set to the local time of their operators. When the local time zone would change between Standard Time and Daylight Savings Time, either the computer clock was changed on the fly (on systems that allowed it), or it was changed during a reboot. These two methods have short comings which became more apparent after computers were connected to the outside world for the following reasons:

many systems needed to be up 24/7 (24 hours a day, 7 days a week) which morphed into 24/365 (24 hours a day, 365 days a year). Think bank machines and air-line scheduling systems for example.

computer programs that needed to record elapsed time would have to compensate for the missing hour when measuring across the change boundary

possible problem scenario #1: Your computer is in location where the time zone changes between EST (Eastern Standard Time) and EDT (Eastern Daylight-Savings Time) You have a user in who creates a file (with a time stamp) at 1:45 AM EDT on the morning that the clock will fall back. 15 minutes later at 2:00 AM (EDT) you move the clock back to 1:00 AM (EST) by either changing it or rebooting. Ten minutes later at 1:10 (EDT) local time, a second user connects to the system and updates the file in question. This file now has a creation time stamp that is before the modification time stamp. If the second user is smart enough not to mess around with the original file, then the second file will still have a creation date which is before the creation date of the first file

possible problem scenario #2: The same computer is on the Internet A technical support person FTPs a file from the client system in Canada to a support system in Germany, works on the file, then FTPs it back to Canada. The Canadian system clock changes in between FTPs Which file is the new one? Are we sure that no German time stamps will end up on the Canadian system? As long as the files in questioned are never accessed by anyone but the German Tech support person, everything should be all right. But, if another person becomes inadvertently involved, a real mess could ensue.



When properly implemented, file creation and modification dates are stamped in a UTC time format. Also, the system clock no longer changes twice a year. However, user processes are able to display a shifted "local clock" if desired.

NTP (Network Time Protocol)

an NTP stratum #1 source is a computer " running NTP software " and is receiving real time information from one of the following: an Atomic Clock a GPS (Global Positioning System) Radio receiver which derives it's signal from at least 2 GPS satellites which then derive their clocks from a military source (usually an Atomic Clock) another (peer) stratum #1 NTP server

" and is receiving real time information from one of the following: any other computer that is running NTP software will have three types of NTP connections, SERVER, PEER, or CLIENT.

any time a computer receives time information from any source, it must do at least 2 things: make up to 5 network transactions per query in order to compute the average transaction time (distance) between itself and it's next higher stratum source it must increment the stratum number so that connected computers are aware of the quality of the time (a higher number means lower quality)



Caveat: a block diagram used to be here. It was created before Wikipedia existed. Click the next link here for a better description and diagrams

https://en.wikipedia.org/wiki/Network_Time_Protocol

Daylight Savings Time (this was a dumb idea)

DST History

All my life, people have told me that DST (daylight savings time) was created to help farmers. Anyone who knows any farmers already knows that farmers ignore clocks so this has to be a myth. In fact, the (mostly) farming province of Saskatchewan in Canada never adopted DST.

The truth of the matter is this: DST was popularized by Germany after World War One where the use of DTS aided the German war efforts by extending the working length of the military day https://www.timeanddate.com/time/dst/history.html

Now here's a smart idea. The European Parliament (EU) just voted to end daylight savings time in 2021

https://www.nytimes.com/2019/03/27/world/europe/daylight-savings-time-european-union.html

https://www.npr.org/2019/03/27/707179979/european-parliament-moves-toward-ending-daylight-saving-time

The main reason given was that Europe's closest trading partners, China and Russia, do not shift their numerous number of time zones, and having Europe change its clocks twice annually was bad for business between all. But as a computer programmer and system admin, I can tell you that not having your computer systems change their internal clocks is a huge advantage.

Solaris (a flavor of Unix created by SUN Microsystems)

Solaris System Time Zone: is defined for your system in file " /etc/TIMEZONE " and must be one of the zones defined in directory " /usr/share/lib/zoneinfo " general notes: TIMEZONE can contain something like " TZ=Canada/Eastern " but " TZ=UTC " or " TZ=GMT " are better choices even if TIMEZONE contained something like " TZ=Canada/Eastern " the system clock does not actually change but "time displays" with the "date" command would contain the correct EST/EDT suffix. Use the "date -u" command to see universal time If you change this file then you'll need to reboot because almost everything in Unix is cached by default This file is not a script technical notes: many hardware clock chips (BIOS) do not know about time zones. This means that most Unix systems will run a cron job at 2:01 everyday in March and October to execute the "rtc" command which will make sure the hardware clock contains the correct time zone interpretation. If you don't do this then the system might not have the correct time if rebooted. This hack is not required when the system time is sent to a non-changing time zone like GMT or UTC. (but be sure to read the next note) many hardware clock chips (BIOS) are not accurate and may drift over time. But in most cases the Unix system clocks have been synchronized to an atomic clock by NTP. If your version of NTP does not update the hardware clock, then it is a good idea to run a cron job every day of every month which will run the "rtc" command

Solaris Process Time Zone: by default, all processes see the system time zone setting unless shell variable " TZ " is defined in a common login script called " /etc/profile " or an optional user login script called ".profile" either one of the scripts could set a local environmental variable called " TZ " which must be one of the time zones defined in directory " /usr/share/lib/zoneinfo "

Example Unix Commands:

Legend: sr = system response ur = user response ------------------------------------------- <sr> (see your shell prompt) <ur> date <sr> Wednesday January 24 07:34:11 EST 2007 (see your prompt) <ur> date -u <sr> Wednesday January 24 12:34:13 GMT 2007 your prompt

Update: 2020.04.03

Oracle acquired SUN Microsystems in 2010 which means the a lot of older platforms running SunOS and/or Solaris now needed to purchase annual support agreements for patches that used to be provided for free. Our platforms were purchased with higher up-font fees (so the patches were really not free) but there was no way we were going to pay twice so a decision by head office to not purchase additional support.

I just noticed that one of our Solaris boxes (Solaris-8; just a sever with no users) was not changing over to DST properly. From what I can see, they were missing the DST rules assigned by the US Energy Policy Act of 2005 which went into effect in March of 2007. Since no one complained this was not something that needed to be fixed but I decided to do so anyway.

First off, the size of the time zone files under " /usr/share/lib/zoneinfo " is much larger than they need to be so I decided to investigate the man pages. Here you will learn that zdump is used to view the contents of the zone files and zic (zone information compile) is used to modify them

su - # this must be done from root cd /usr/share/lib/zoneinfo # navigate here zdump -v Canada/Eastern # see a detailed dump for the desired zone

" is much larger than they need to be so I decided to investigate the man pages. Here you will learn that is used to view the contents of the zone files and (zone information compile) is used to modify them It turns out that the zone files contain DST rules going back many decades before the UNIX epoch (1970.01.01) and that OS and C/C++ libraries call these files when doing date-time calculations. If this is not a requirement for your system then it might be better to set your system clock to UTC then add this command to your system wide profile.

TZ=EST5EDT,M3.2.0,M11.1.0 Caveat: any user still using a definition like this "TZ=Canada/Eastern" will not see the correct time.

Caveat: any user still using a definition like this "TZ=Canada/Eastern" will not see the correct time. The ZIC command allows you to add new rules to individual zone files. To fix my problem I added EDT for 2007-03-xx and an EST rule for 2007-11-xx but the procedure is dangerous (unless you backup your zone files first) so I am not going to document it here. Best to leave this to your local friendly uber-nerd.

VAX/VMS System Time

is not relevant to

TOY (Time-Of-Year Clock)

Info derived from P.254 of:

Version 4.4 VAX/VMS Internals and Data Structures

(c) 1988 by Digital Equipment Corporation.

TOY Clock Notes:

based upon a 32 bit unsigned register

the least significant bit represents a resolution of 10 milliseconds

initialized to 10000000 base 16 which represents 00:00:00.00 on January 1

if a booting system sees an empty register, it assumes that the TOY clock has lost power and ignores it

counts up, and only holds about 15 months of time (440 days) so requires external information from a file

to prevent overflow the system must be either be rebooted

or the SYS$SETIME system service must be invoked within the first 3 months of the new year from a privileged account e.g. the system manager needs to execute the DCL command $ SET TIME What does this do aside from setting the time? It writes current date information to files read by the VMS system during boot.



Table Legend:

TOYCPR Time Of Year Clock In Processor Register TOYCC Time Of Year Clock In Console WC Watch Chip BB Battery Backup

Processor TOYCC? TOYCPR? WC? MicroVAX I N N N MicroVAX II N N Y +BB VAX-11/730 N Y opt BB N VAX-11/750

VAX-11/780-782-785

VAX-8600-8650 N Y +BB N VAX-8200

VAX-8300 N Y Y +BB VAX-8500-8550

VAX-8700

VAX-8800 Y +BB N N

TIMEKEEPING in VAX/VMS

Info derived from P.255-256 of:

Version 4.4 VAX/VMS Internals and Data Structures

(c) 1988 by Digital Equipment Corporation.

If the test failed, then SYSINIT assumes that the clock lost power (or had no battery backup) and then prompts the operator

If the test passed, then SYSINIT runs EXE$GQ_SYSTIME and uses the value of the Time-Of-Year (TOY) Clock as an offset (in milliseconds) from a value that is stored in the system image file (SYS$SYSTEM:SYS.EXE) to determine the correct date and time. This value is converted into a 64 bit number which represents the number of 100 nanosecond intervals that have elapsed since 00:00 on November 17, 1858 (the base time for the Smithsonian Institution astronomical calendar). VMS now uses this internal 64 bit clock.

What's up with "November 17, 1858" ?

PRODUCTS: OpenVMS VAX, All Versions OpenVMS Alpha, All Versions VAX VMS, All Versions COMPONENT: System Time SOURCE: Digital Equipment Corporation QUESTION: Why is Wednesday, November 17, 1858 the base time for OpenVMS (VAX VMS)? ANSWER: November 17, 1858 is the base of the Modified Julian Day system. The original Julian Day (JD) is used by astronomers and expressed in days since noon January 1, 4713 B.C. This measure of time was introduced by Joseph Scaliger in the 16th century. It is named in honor of his father, Julius Caesar Scaliger (note that this Julian Day is different from the Julian calendar named for the Roman Emperor Julius Caesar!). Why 4713 BC? Scaliger traced three time cycles and found that they were all in the first year of their cyle in 4713 B.C. The three cycles are 15, 19, and 28 years long. By multiplying these three numbers (15 * 19 * 28 = 7980), he was able to represent any date from 4713 B.C. through 3267 A.D. The starting year was before any historical event known to him. In fact, the Jewish calendar marks the start of the world as 3761 B.C. Today his numbering scheme is still used by astronomers to avoid the difficulties of converting the months of different calendars in use during different eras. So why 1858? The Julian Day 2,400,000 just happens to be November 17, 1858. The Modified Julian Day uses the following formula: MJD = JD - 2,400,000.5 The .5 changed when the day starts. Astronomers had considered it more convenient to have their day start at noon so that nighttime observation times fall in the middle. But they changed to conform to the commercial day. The Modified Julian Day was adopted by the Smithsonian Astrophysical Observatory (SAO) in 1957 for satellite tracking. SAO started tracking satellites with an 8K (non-virtual) 36-bit IBM[R] 704 computer in 1957, when Sputnik was launched. The Julian day was 2,435,839 on January 1, 1957. This is 11,225,377 in octal notation, which was too big to fit into an 18-bit field (half of the IBM standard 36-bit word). And, with only 8K of memory, no one wanted to waste the 14 bits left over by keeping the Julian Day in its own 36-bit word. However, they also needed to track hours and minutes, for which 18 bits gave enough accuracy. So, they decided to keep the number of days in the left 18 bits and the hours and minutes in the right 18 bits of a word. Eighteen bits would allow the Modified Julian Day (the SAO day) to grow as large as 262,143 ((2 ** 18) - 1). From Nov. 17, 1858, this allowed for seven centuries. Using only 17 bits, the date could possibly grow only as large as 131,071, but this still covers 3 centuries, as well as leaving the possibility of representing negative time. The year 1858 preceded the oldest star catalog in use at SAO, which also avoided having to use negative time in any of the satellite tracking calculations. This base time of Nov. 17, 1858 has since been used by TOPS-10, TOPS-20, and VAX VMS and OpenVMS. Given this base date, the 100 nanosecond granularity implemented within OpenVMS and the 63-bit absolute time representation (the sign bit must be clear), OpenVMS should have no trouble with time until: 31-JUL-31086 02:48:05.47 At this time, all clocks and time-keeping operations in OpenVMS will suddenly stop, as system time values go negative. Note that the OpenVMS time display and manipulation routines allow for only 4 digits in the 'YEAR' field. We expect this to be corrected in a future release of OpenVMS sometime prior to 31-DEC-9999.

Calendar Evolution (how the Y2K problem came to be)

Executive Summary During the time of Caesar Augustus, Roman astronomers thought the length of year was 365.25 days so instituted a leap year every four years

comment: Leap Year seems to be a misnomer since that year is a little longer (we didn't leap over anything; we extended)

so instituted a leap year every four years Leap Year seems to be a misnomer since that year is a little longer (we didn't leap over anything; we extended) The actual length of the year is 365.2425 days which means the primary leap year rule (year is evenly divisible by 4) is wrong

comment: well, the Roman calendar was good enough for farmers and sailors but not for academics jump to: jump to: Gregorian Calendar

Calendar Kinds -- a 10,000 foot (3 km) view

Caveat: on 2020-04-11 I discovered this better all-in-one-place article: http://physics.nist.gov/time (A Walk Through Time - The Evolution of Time Measurement through the Ages)

Lunar Calendars



the true year (the length of time required for the Earth to orbit the Sun) is not a whole number of lunar months. A 12 month lunar year is too short while a 13 month lunar year is too long. the lunar orbit around the Earth is elliptical rather than circular (and the ellipse orbits slowly over the course of ~ 19 years)

Solar Calendars (or more correctly, Solar-Lunar Calendars)



Click here to examine four popular calendars (two lunar, two solar)

Egypt ~ 4231-2773 BC

Greece ~ 440 BC

Greece ~ 325 BC

Greece ~ 200 BC

Single Dial Side Planetarium: Displays the position of the Sun, Moon, and five planets (Mercury, Venus, Mars, Jupiter and Saturn) are displayed. The Moon pointer changes speed reflecting the moon's elliptical orbit) The individual planetary pointers will occasionally move backwards reflecting retrograde motion

Dual Dial Side Calendar: Displays 235 lunar months over 19 years

The Callippic Dial is the left secondary upper dial, which follows a 76-year cycle, quadrupling the Metonic dial

The Olympiad Dial is the right secondary upper dial for determining the dates of the Olympic games Eclipse Predictor: both lunar and solar

The Pragma of Rome

Rome - 753 BC

Rome - 304 BC



Rome - 45 BC (the calendar moves to 365.25 days)

Solar Calendar Before Julius Caesar

(requires a leap month every two years;

February is smaller at this time) Martius (March ) Aprilis (April ) Maius (May ) Junius (June ) Quintilis (July ) Sextilis (August ) 7th month (September) 8th month (October ) 9th month (November ) 10th month (December ) 11th month (January ) 12th month (February ) Mercedonius (wages ) 31 days 29 days 31 days 29 days 31 days 29 days 29 days 31 days 29 days 29 days 29 days 28:23:24) (22-23) -------- 366 days Solar Calendar After Julius Caesar

(requires a leap day in every fourth

February) Martius (March ) Aprilis (April ) Maius (May ) Junius (June ) Julius (July ) Augustus (August ) 9th month (September) 10th month (October ) 11th month (November ) 12th month (December ) 1st month (January ) 2nd month (February ) 31 days 30 days 31 days 30 days 31 days 31 days 30 days 31 days 30 days 31 days 31 days 1+ 28 days ----------- 365.25 days

Nicaea - 325 AD



Rome - 523 AD (years change from AUC to AD)

conveniently restarted near the birth of Christ

mathematical beauty

near the birth date of Jesus Christ

Superscripts: The variation of the Metonic Cycle works like this: 19 years (the Metonic Cycle)

4 years (the Callipic Cycle helps to account for leap years)

7 days in a week (Easter must fall on a Sunday)



532 years = 19 x 4 x 7

The beginning of this cycle falls on January 754 AUC which Dionysius renamed to 1 AD ("anno domini" meaning "year of our Lord").

According to the Gospel of Luke (3:1 & 3:23) Jesus was "about thirty years old" shortly after "the fifteenth year of the reign of Tiberius Caesar". Tiberius became emperor in AD 14. If you combine these numbers you reach a birth year for Jesus that is strikingly close to the beginning of our year reckoning. This may have been the basis by Dionysius' argument. (on the flip side, the Gospel of Luke mentions a Roman Census which historical records say is the Census of Quirinius which occurred in 6/7 AD).



The Gospel of Matthew tells us that Jesus was born under the reign of king Herod the Great

Since Herod died in 4 BC. It is likely that Jesus was actually born between 5 BC and 7 BC.



Today it is commonly believed that Dionysius made a mistake in determining the exact date of Christ's birth but this was not his intention . In 523 only pagans celebrated birthdays meaning that those Christians had no intention of celebrating Christ's birth.



Rome - 1582 AD (the calendar moves to ~ 365.2425 days)

Easter was originally linked to Passover, but in the year 325 AD at the council at Nicaea, it was decided that Easter would be celebrated on the first Sunday following the first full moon on, or after, the vernal equinox (the passing from winter into spring). In the year 325, the vernal equinox was assumed to be fixed at March 21.



Due to inaccuracies in the calendar, by the 16th century the vernal equinox was occurring on March 11. This caused problems for the church in Rome because most Christians outside of Rome were using the date "March 21" to calculate the day of Easter rather than the "vernal equinox" event. (sometimes bad weather combined with a lack of local astronomers made "the calendar option" the only choice). This had the effect of pushing the day of Easter celebration closer to the summer months.

Pope Gregory XIII assigned the problem to a Jesuit astronomer named Christopher Schlussel (a.k.a. Clavius) who suggested that the Easter/equinox problem could be solved by removing 10 days from the current year (shifting the vernal equinox back to March 21) but from that time forward the Christian world should adopt the idea proposed by Aloysius Lilius. The plan was approved by Pope Gregory approved the plan in 1582 and decreed that October 4 was followed by October 15. The peasants revolted thinking that their lives had been shortened by that much. The new calendar was named the Gregorian Calendar after the pope who approved the changes.

This so-called "continental calendar" wasn't adopted by England, or its colonies including America, until 1752. At that time, 11 days needed to be removed. (10 for the original correction, 1 for the century following)



Facts:

The Earth requires 365.2425 mean solar days (averaged over 4 years) for one revolution around the sun, not 365.25 as is commonly believed This difference translates into ~ 648 seconds per year which needed to be removed to correct for Easter as defined in 325 AD Computations:

Year 2 Year 1 difference

(in years) approximate error

seconds per year approximate total

error seconds equivalent days

(86400 secs/day) a 1582 AD 325 AD 1257 648 814536 9.4275 b 1752 AD 325 AD 1427 648 924696 10.7025

Computer Calendar Bugs

Year 2000 Problem (a.k.a. the Y2K Problem)

Part 1: Short Field Storage (a.k.a. lazy programming)

God hits the RESET button.

(but the problem was caused by man) When dealing with dates, many programmers decided to only code for, and store, the least two significant digits of the year. This started with early mainframe programmers (1950s-1970s) who only had 80 columns of storage on each punched card. This tradition was continued on minicomputers (1970s-1980s) and PCs because memory and storage were still very expensive. There is no need to do this now.

True Fact: In 1989 a woman in who was born in 1884 was placed on a Kindergarten enrollment list because her 2-digit birthday (89) indicated that she was 5 years old.

Now imagine the problems on January 1, 2000 when automated programs...

decide to purge seemingly stale records decide to compute negative interest values decide to lock-out seemingly expired credit cards?

Although most currently supported operating system software has been fixed, much application software, and firmware associated with old harware, are still broken. Unsupported software (like MS-DOS) and obsolete firmware (like PC BIOS before 1995) will probably never be fixed. Furthermore, application software that makes direct BIOS calls to check the date instead of calling a similar routine in the operating system is at great risk since the application software will only fail on certain platforms.

If (for productivity reasons) your users only enter 2 digit years, programmers should translate these dates to 4 digits for storage. Failure to do this means this problem will be back in the year 2100.

Part 2: Is 2000 AD a Leap Year? (Yes)

Leap Year

Rules Rule Name

(Informal) Description Remark 1 divide by 4 If a year is evenly divisible by 004, then that year is a leap year.

Using this rule, 2000 AD is a leap year. Everyone knows this rule 2 divide by 100 If a year is evenly divisible by 100, then that year is not a leap year.

Using this rule, 2000 AD is not a leap year. Many people seem to

know this exception 3 divide by 400 If a year is evenly divisible by 400, then that year is a leap year.

Using this rule, 2000 AD is a leap year (which is true). Few people seem to know this

exception to the exception 4 divide by 4000 If a year is evenly divisible by 4000, then that year is not a leap year Proposed

Y2004 Problem

http://news.com.com/2100-7355-5129875.html (Software glitch in 2004 brings Y2K déjà vu)

Y2010 Problem

It's only 10 years since Y2K and some bozo programmers didn't learn the lesson. Now we've got problems with portable devices running WindowsCE along with other stuff.

Y2038 Problem (and Y2106 Problem)

If the 32-bit clock location was treated as a signed integer, then there are only (2^31 = 2,147,483,648 seconds) ~68.051 years of range before we overflow. 1970 + 68 = 2038. BTW, the exact rollover date is: 3:14:08 AM (GMT) on January 19, 2038 caveat: some older user software depends upon the fact that negative numbers can be used to represent a limited number of dates before the Unix epoch. This stuff must be renovated ASAP

If the 32-bit clock location was treated as an unsigned integer, then there are only (2^32 = 4,294,967,296 seconds) ~136.103 years of range before we overflow. 1970 + 136 = 2106.

I am convinced that "C" libraries and related OS calls will be modified to either 32-bit unsigned or 64-bit before 2038. According to this article, https://en.wikipedia.org/wiki/Year_2038_problem Linux already has fixed this problem which is probably one reason why Linux is found in the datacenters of most banks and insurance companies.



I wonder how much embedded "C" software will still be working in bank machines, credit card readers, and PC BIOS firmware?

Y4K Problem?

Never take chances. Always call operating system routines rather than doing the date calculations yourself. The operating system software designers have consulting astronomers on staff to assist in this sort of thing. They will almost always do a better job of this stuff than the little guy.

BIOS routines are written in firmware. Operating Systems are written in software. Since the BIOS routines may be broken but the operating system may be fixed, never call the BIOS directly, Always call the operating system routines.

I'm not going to upgrade to Windows 95. Windows 3.11 is good enough for our company.

(Bill Gates isn't going to squeeze me for some feature that I don't need)



(Bill Gates isn't going to squeeze me for some feature that I don't need) I'm not going to upgrade to Windows 98. Windows 95 is good enough for our company.

(Bill Gates isn't going to squeeze me for some feature that I don't need)



(Bill Gates isn't going to squeeze me for some feature that I don't need) I'm not going to upgrade to Windows 2000. Windows NT4 is good enough for our company.

(Bill Gates isn't going to squeeze me for some feature that I don't need)

Date/Time Stamps (and displays)

1. the most significant field (year) appears first while the least significant field (day) appears last. Similar to the odometer in your car.



2. By removing any slashes, everyone will automatically know which time format is being used. The lack of slashes will also allow the string to be used in computer file names. Some computer file systems (Unix) will allow more than one period in the file name.



3. Leading zeros must always be used to pad fields (e.g. month must be 05 not just 5)

970510 (should only be used on print outs) 19970510 (can also be used internally ) 970510.2359 (should only be used on print outs) 19970510.2359 (can also be used internally ) 970510.235959 (should only be used on print outs) 19970510.235959 (can also be used internally ) ^ +--------- indicates a switch from date to time

970510:2359 (should only be used on print outs) 19970510:2359 (can also be used internally ) 970510:235959 (should only be used on print outs) 19970510:235959 (can also be used internally ) 970510:235959.10 (should only be used on print outs) 19970510:235959.10 (can also be used internally ) ^ ^ | +--- indicates a switch to fractions of a second +---------- indicates a switch from date to time

rm 199705* to delete all May 97 files in Unix del 199705*.* to delete all May 97 files in DOS del 199705*.*;* to delete all May 97 files in OpenVMS

Links:

13 Month Calendar?

7 days * 4 weeks = 28 days per month 28 days * 13 months = 364 days per year

With a standard 28 days per month it would be easier for businesses and governments to do monthly economic forecasts. Since western workers usually skip between 2-4 work days near the end of December (Christmas, Boxing Day, etc.), this month would be the best candidate to extend by one or two days.

The 13 month calendar would be better for anyone paid once or twice monthly.

DST07 (Daylight Savings Time 2007)

Java Libraries

C/C++ Libraries

Oracle Database

Some Messaging Systems with links into PDAs like the Blackberry

Some Application Software (containing baked-in DST code)

To add insult to injury, since those Y2K days many North American computer professionals have been let go and their jobs have been outsourced to India where people don't observe DST because they live so close to the equator. Oh well, just another mess linked to the effects of extreme market capitalism.

DST07 and UNIX

To the best of my knowledge, no RTC (real time clock) chips save the time zone. This means that just after a computer's local time has changed, a BIOS call must be made to save the new time to the RTC chip. Failure to do this means that a rebooted computer may come up with the wrong time. For the past 20 years most UNIX systems updated the RTC from root's crontab by calling /usr/sbin/rtc every morning in APRIL and OCTOBER like so.

% crontab -l # # This is root's crontab # The rtc command is run to adjust the real time clock if and when daylight savings time changes. # 10 3 * * 0,4 /etc/cron.d/logchecker 10 3 * * 0 /usr/lib/newsyslog 15 3 * * 0 /usr/lib/fs/nfs/nfsfind # run task every day in April at 3:01 AM 1 3 * 4 * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 # run task every day in October at 2:01 AM 1 2 * 10 * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 %

To fix your system you'll need to implement one of the following two suggestions. If you don't know how to make these changes then you'll need to contact your local UNIX guru.

# # The two red lines above could be replaced with the following ( suggestion #1 - preferred ) # # run task every day at 3:01 AM 1 3 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1

# # The two yellow lines above could be replaced with the following ( suggestion #2 - alternate ) # # run task every day in March + April at 3:01 1 3 * 3,4 * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1 # run task every day in October + November at 2:01 1 2 * 10,11 * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1

You should to stick with database support

A good way to avoid future date-time problems is to stick with products with built-in support. For example, there a datetime object built into most databases. Look at these two examples from MySQL + MariaDB. The second example is a hack to magically return the data in ISO-8601 format

MariaDB [(none)]> select now(); +---------------------+ | now() | +---------------------+ | 2018-10-22 14:13:23 | +---------------------+ 1 row in set (0.00 sec) MariaDB [(none)]> select now()+0; +----------------+ | now()+0 | +----------------+ | 20181022141330 | +----------------+ 1 row in set (0.00 sec) MariaDB [(none)]>

Links

Calendars

Date + Time Formatting