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 ...

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.  

Apple TV HD - The Best Streaming box ever

I purchased my Apple TV on its release day, in October 2015.  It continues to serve me perfectly, after nearly 10 years of active use. Although it is decidedly not the newest model of Apple TV, it does 100% of the things I want it to do without any issues.  Sure, I'd love a more modern SoC, gigabit Ethernet, Thread support, 4k video support, etc, but honestly I am not missing any of those features, so "upgrading" it today would be a waste of money.  I did sell the original Siri remote in 2023 and upgrade to the 3rd generation (USB-C) Siri remote. The original Siri remote was working great, but I figured after 7.5 years of use, it was time to get a new remote with a new battery.  I will likely upgrade my Apple TV in the future, but I can't predict when that will be.   Due to a quirk of its release strategy, this Apple TV was discontinued in late 2022, and so it is likely to be supported for several more years. A new device would have to be a leap ahead, because m...

Canon SD890 Review

My Canon PowerShot SD890IS Review Wahoo! I just received my new Canon PowerShot SD890IS . Here's my review of the new SD890IS. Updated! (20-April-2008)! I like taking good photos. And I hate lugging around big cameras and equipment. And so I concluded that I needed to buy myself an awesome point-n-shoot camera. I often take pictures in difficult conditions, such as a museum where a flash camera is prohibited. Or a concert, where I can't use a flash, the lighting is low, and the people on stage are in motion. Or with the zoom cranked up and focused on a distant subject. Taking good photos in these conditions, with a small lens camera and without a tripod is a challenge at best. In comes the SD890. I was particularly excited about the SD890 because it is pocketable, yet it has awesome specifications: Image stabilization ; a 5x zoom lens, and 10 megapixel resolution. When I bought the camera, I imagined that these features would help me take much better pictures in the...

Repairing a Crate TX15 Taxi amplifier battery

A friend gave me a Crate battery guitar amp that he used for busking. It is a nice 15 watt amp with an internal battery. Sadly it died, and its custom power adapter was misplaced. After several years the battery will fail, and it requires a functioning battery to work at all. Happily, new batteries are inexpensive, readily available, and easy to install. Obtaining a replacement battery for the TX15 The original battery was a 4+ pound, sealed lead battery. Any replacement battery should closely follow the specs of the original. I bought this MightyMax Battery on Amazon , which is a perfect replacement. There are many batteries that conform to the needs of the TX15, and they can be found at local hardware stores as they are commonly used in lots of equipment. It pays to look locally if you need something faster than Amazon.  The battery specs are as follows: 12 Volt, 7.2 Ah lead battery (mine was marked 1272). Length: 5.94" (151 mm)  Width: 2.56" (65 mm) Height: 3.94" (100...

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...

Other Posts

Show more