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.  

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

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

Fixing my Wahl 9918 Groomsman Beard and Mustache Trimmer

Not everyone would bother repairing a $25 beard trimmer, but why not fix something for under $5 instead of spending another $25? My  Wahl 9918 Groomsman Beard and Mustache Trimmer  has admirably performed its beauty duty for many years, but the time came when the battery just wasn't holding a charge any more.  Most people would just put the trimmer in the trash and buy a new one, but I figured I could repair my otherwise excellent Wahl and save some money. In fact, even high priced trimmer and rotary shaver brands, like Norelco and Remington, can be easily repaired using a process similar to the one I used to fix my Wahl.  Read on to find out how. I opened up the Wahl by popping off the black plastic faceplate with a tiny flathead screwdriver, which revealed two screws.  By removing the two screws I was able to easily open up the unit, revealing the guts of the device. Backplate off, Revealing the screws The internals are rather simple: a motor, a...

Transitioning to Comcast Now!

I've transitioned to Comcast NOW, a lower speed, lower cost alternative.  The kids have grown up and moved out.  I'm spending much more of my time traveling.  I don't need the high speeds at home like I used to. This transition promises to save me $240 dollars a year versus my old "discounted" plan. Xfinity to Comcast Now transitioning process I went to the Xfinity store and told them I was cancelling two weeks out.  This isn't weird - people move all the time, so they do have a process for cancelling at a future ("move-out") date. Later the same day, I was able to go to the Comcast website and order the NOW modem for the new service. Note that Comcast didn't let me do this until I had a future cancel order in place.  Three days later, the modem arrived via FedEx. The cancel date came and went - Xfinity seems to have a grace period, so the old modem wasn't unceremoniously yanked out of service at midnight.  This made the transition smooth.  ...

Other Posts

Show more