Skip to main content

Time to think about Time seriously!

Attention programmers!

Good logic lasts forever.

Many of you were not in the programming business in the 1980s.  Back then, we realized that Y2K was on its way and there was a lot of code that would break with dates beyond 1999-Dec-31.

At the time we were looking to save storage - heck, I supported systems that stored the year in 4 bits, because  it was a huge memory saver, and 16 years of operation was a long time.  We simply expected that our systems would be retired before then.

But come the 1990's, we realized we were still running programs written in the 1960s, and someone would have to address all of the date calculation problems.

Turn the clock ahead to today and we see that in less than 25 years the classic 32-bit Unix clock will turn over.    And the storage problem no longer exists like it once did.  In the past we often tried to squeeze in a full Gregorian date (Y-M-D) into 15 or fewer bits.    Today, using 24 or 32 more bits to store a Gregorian date seem completely reasonable and will greatly outlast our era.

Best practice demands that our code of today will work perfectly with dates into and beyond 2038.  As programming matures as a business, we should be validating clocks and times and dates well into the future, at least beyond 2101.

Are you signing a contract for software services?  Demand proper testing for this problem today.  Code easily lasts for more than 25 years, and so not demanding proper date handling behavior is irresponsible and a dereliction of your professional obligations.  Period.

Our software will be running in 80+ years into the future?

Why not?  Buildings and bridges are designed and maintained to last for centuries... we hope.  Logic lasts forever; why dispose of otherwise good work?

Popular posts from this blog

Fixing a SodaStream Jet, part 1: Disassembly Guide

I've had my SodaStream Jet for years, and once in a while something has gone wrong. Disassembly is the first step to repair.  Start with this article to see how to disassemble the SodaStream, and then once you have that down, scroll through my other articles to see how I repaired specfic SodaStream problems. SodaStream Jet Disassembly Guide Tools Required Flat head screwdriver Phillips head screwdriver 1. Remove the Carbonator.  Duh. 2. Remove the black panel lever The front big black tilt lever needs to be removed first. Removing this panel is tricky, but it isn't impossible. Looking up at the bottom of the black panel, there are two tabs, one on the left and one on the right. These tabs fully secure the panel in place. The trick is to use a flat-head screwdriver under the plastic to gently lever the tabs out of the way.  Note in the pictures how I approach these tabs with my screwdriver.  I usually release the left side first, and then I release ...

Fixing a SodaStream Jet, Repair #2 - Broken Fill Button

My Soda Stream Jet's fill button broke, which means I can not longer carbonate water by pressing the pushbutton. This caused all sorts of grief in my household. Here is how I managed to repair my Jet to give it another 10 years of life (hopefully). First, a look at the button The fill button on the top of the SodaStream is actually a simple lever. Pressing down on the button moves a pin that does the actual work of pressing open the Carbonator's valve. Unfortunately, the axis point is fairly thin and can see a lot of stress. That's where my Soda Stream button cracked. [ I think the usage tip here is "don't over-press the button like a gorilla, it doesn't do anything but put high stress on the button."] Cracked levering point of the button The Pesky Lever Retaining Pin The Fix It was pretty easy for me to replace the button: Take off the back of the Soda Stream and remove the carbonator. Push out the the button lever's steel retaining pin. This takes qu...

Macintosh: Upgrading an eMac

It's been a long time since I wrote this article, but the fact remains: The good old eMac can still be useful if you take the simple steps to keep it as good as it can be.  All can run Tiger, and most can run Leopard - great operating systems for their day with a bit of useful life.  This article describes the procedure I used to upgrade my old eMac, including: Replacing the internal hard disk with a large capacity drive. Increasing the memory for performance Upgrading the operating system Here I'm upgrading a 700 MHz eMac, but the procedure and tasks for upgrading other eMac models should be almost identical. Upgrading versus Replacing My sister's eMac is of the 700 mhz variety, with 256 MB of memory. The machine seemed to be getting "slower", and the original 40 GB disk was becoming jammed packed with photos and iTunes, and within a few months she'd be out of disk space. There were two options to address the problems: upgrade the eMac, or go o...

Installing a CarPlay radio in a Honda CRV

I ended up buying a 2013 Honda CRV and decided to replace the stock radio/CD player with an upgraded unit.  This was far easier and cheaper than I imagined, but the hardest part was selecting a unit to buy  This article covers how I made my choice.   The basic form factor for my CRV head unit Selecting a Unit The Car I have a 2013 CR/V, which is the same series of all of the CR/Vs from model year 2012 through 2016. Therefore it was important to find a radio unit that fits this model. The CRV has steering wheel radio controls, and I wanted to use them.  This uses a technology called CAN-Bus, which is kind of like USB for cars.  Therefore, a CAN-Bus capability would be able to leverage all these steering wheel features.  In addition, the CRV has a backup camera that would be nice to tie into. And of course I wanted to leverage the existing speakers and USB port. Form Factor I wanted a unit that had a big display, and I wanted a unit that was easy to purchas...

Using a Garmin eTrex with a Macintosh or Linux

The Garmin eTrex series consists of decent, full featured handheld GPS units. The cheaper monochrome eTrex models have a basic RS-232 serial interface, and the color eTrex models sport USB connectivity. In this article I'll talk about my experience with connecting both USB and serial port versions of the eTrex series to my Mac and to my Linux-based PC. I personally use the Garmin Vista HCx GPS now, but the other Garmins in the eTrex series, including the inexpensive but well specified Garmin eTrex Venture should work the same way. Dealing with the eTrex Series with USB Most of the eTrex units with a color screen have a USB port on the back. Happily, this USB port uses a common USB connector, so it is easy to physically connect a USB eTrex to a Mac or a PC running Linux. The USB Port on an eTrex I have found two pieces of software perfect for use with a USB eTrex, without the need for special drivers: GPSBabel+ and Google Earth . The Mac version of the freeware program ...

E-waste portfolio grows, thanks to the losers managing Ring.

 I just installed a Ring doorbell the other day, and in perusing the website I read this gem: "security updates until at least four years after the device is last available for purchase"  Four years is all Ring promises for a brand new device?  This isn't 2007.  It's a mass market doorbell and a camera, something expected to be safely used for years, if not decades.  Even my home router has a longer promised life, and that's saying something. Ring management must be embarrassed by their ineptness.  They're idiots, and clearly the only way they know how to make a buck is not through great ideas and great implementations, but through planned obsolescence and customer abuse.  

Other Posts

Show more