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

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

Installing the Eve Smart MotionBlind Upgrade with my Large Roller Shade

I have a large window in the front of my house and a roller shade was just the right window treatment for it.  But I also wanted to automate it. My MotionBlind Upgrade kit and my new roller shade I looked around to buy something that I was comfortable with, but simple non-automated roller blinds can be expensive, especially when they're larger than 6 ft x 6 ft.   This is disappointing, as a roller blind is just a tube with a small amount of synthetic cloth but can easily cost hundreds of dollars. Plus, since I wanted a smarthome blind, we're talking $500 or more from the "service oriented shops". I'm a tech guy.  I think can do better. After thinking about DIY and creative solutions, I decided to try out the Eve MotionBlinds Upgrade (MBU) kit.  This kit transforms an ordinary roller blind into a smart blind.  The MotionBlinds mechanism is basically consists of a small motor and battery in a long metal tube.  This motor tube slides into a roller blind ...

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

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

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

Other Posts

Show more