# Y1.8K.

**URL:** <https://boards.straightdope.com/t/y1-8k/814987>\
**Category:** Factual Questions\
**Created:** [May 28, 2018, 6:48pm UTC](https://boards.straightdope.com/t/y1-8k/814987 "2018-05-28T18:48:13Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Rysto](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@Rysto](https://boards.straightdope.com/u/Rysto)\
**Post date:** [May 29, 2018, 2:54am UTC](https://boards.straightdope.com/t/y1-8k/814987/21 "2018-05-29T02:54:06Z")

</div>

I’m not sure it will be so easy. At my last employer, we were running on 64-bit systems and theoretically should have been safe, but our own code wasn’t written very well and frequently used “int” where they should have used time\_t. The tricky thing is that the code appears to work, and will continue to work for another 20 years or so before it suddenly explodes.

I wonder how much code like that is out there. Even professional programmers can be surprisingly lazy and or ignorant about such things.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [May 29, 2018, 2:58am UTC](https://boards.straightdope.com/t/y1-8k/814987/22 "2018-05-29T02:58:12Z")

</div>

> [@Rysto](#):
>
> I’m not sure it will be so easy. At my last employer, we were running on 64-bit systems and theoretically should have been safe, but our own code wasn’t written very well and frequently used “int” where they should have used time\_t. The tricky thing is that the code appears to work, and will continue to work for another 20 years or so before it suddenly explodes.
> 
> I wonder how much code like that is out there. Even professional programmers can be surprisingly lazy and or ignorant about such things.

Yeah…  
But, dumping the code into a modern compiler with strict type-checking turned on should find those types of errors.

Assuming the source code still exists.

---

<div class="post-metadata">

**Author:** ![Colophon](https://avatars.discourse-cdn.com/v4/letter/c/f05b48/32.png) [@Colophon](https://boards.straightdope.com/u/Colophon)\
**Post date:** [May 29, 2018, 9:06am UTC](https://boards.straightdope.com/t/y1-8k/814987/23 "2018-05-29T09:06:32Z")

</div>

> [@Tim\_T-Bonham.net](#):
>
> The next workday, I got a phone call from one institution reporting that the heading on a report of prescription medication dispensed the previous day said “Medication Dispensed on Jan 1, 19100”. They stated that the content of the report was correct, but they were laughing at the heading. Asked how much overtime they would get paid for working from Dec 31, 1999 through Jan 1, 19100? But none of the couple dozen other institutions had noticed the error, or thought it even worth reporting. I fixed it in under an hour, and sent a note to all of them offering to re-run the corrected report for them – none thought it worth bothering to re-run.

If you Google [“January 1 19100”](https://www.google.co.uk/search?q=%22january+1+19100%22&rlz=1C1GCEA_enGB788GB788&oq=%22january+1+19100%22) you find plenty of reports of such problems. I remember seeing quite a bit of this on the web at the time, but as you say it was usually non-critical.

---

<div class="post-metadata">

**Author:** ![Quartz](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/quartz/32/267_2.png) [@Quartz](https://boards.straightdope.com/u/Quartz)\
**Post date:** [May 29, 2018, 10:36am UTC](https://boards.straightdope.com/t/y1-8k/814987/24 "2018-05-29T10:36:25Z")

</div>

> [@Musicat](#):
>
> In other words, humans are smarter than computers. Good thing, cause there were no computers in '94.

That’s not exactly correct. Herman Hollerith invented his tabulating machines in the 1880s. If years were encoded on the cards as 2 digits then they would have had the same problems.

---

<div class="post-metadata">

**Author:** ![Musicat](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/musicat/32/20189_2.png) [@Musicat](https://boards.straightdope.com/u/Musicat)\
**Post date:** [May 29, 2018, 10:55am UTC](https://boards.straightdope.com/t/y1-8k/814987/25 "2018-05-29T10:55:02Z")

</div>

> [@Quartz](#):
>
> That’s not exactly correct. Herman Hollerith invented his tabulating machines in the 1880s. If years were encoded on the cards as 2 digits then they would have had the same problems.

I knew someone would want to contradict me 🙂 but you may have glossed over my subtle point…I referenced '94 without mentioning the century, heh, heh. How do you know I didn’t mean 1794?

---

<div class="post-metadata">

**Author:** ![mcgato](https://avatars.discourse-cdn.com/v4/letter/m/ac8455/32.png) [@mcgato](https://boards.straightdope.com/u/mcgato)\
**Post date:** [May 29, 2018, 12:48pm UTC](https://boards.straightdope.com/t/y1-8k/814987/26 "2018-05-29T12:48:49Z")

</div>

If computers had been around in 1900, the problem probably would have been February 29 appearing when it isn’t a leap year.

---

<div class="post-metadata">

**Author:** ![RealityChuck](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/realitychuck/32/195_2.png) [@RealityChuck](https://boards.straightdope.com/u/RealityChuck)\
**Post date:** [May 29, 2018, 12:58pm UTC](https://boards.straightdope.com/t/y1-8k/814987/27 "2018-05-29T12:58:26Z")

</div>

Actually, there was a problem with two-digit dates even back as far as 1900.

In cemetaries.

People would get headstones in advance, and since it was cheaper to engrave it at one time, people would put 1845-18\_\_ as the inscription. Some lived past 1900, so things had to be redone.

The same thing occurred in 2000, though I think the funeral directors were more award of the possibility.

---

<div class="post-metadata">

**Author:** ![Rysto](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@Rysto](https://boards.straightdope.com/u/Rysto)\
**Post date:** [May 29, 2018, 1:16pm UTC](https://boards.straightdope.com/t/y1-8k/814987/28 "2018-05-29T13:16:31Z")

</div>

> [@beowulff](#):
>
> Yeah…  
> But, dumping the code into a modern compiler with strict type-checking turned on should find those types of errors.

Yeah, no. Not a chance. Have you ever actually turned on those checks on a serious program? Implicit integer conversions are endemic in C/C++. Eliminating them all in a real-world program simply isn’t plausible. If you were to try to use the checks to find time\_t conversion errors you’d drown in the noise.

What will probably happen is that compilers or static type checkers will have a special case for warning specifically about converting time\_t to other integer types.

---

<div class="post-metadata">

**Author:** ![beowulff](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/beowulff/32/542_2.png) [@beowulff](https://boards.straightdope.com/u/beowulff)\
**Post date:** [May 29, 2018, 1:38pm UTC](https://boards.straightdope.com/t/y1-8k/814987/29 "2018-05-29T13:38:41Z")

</div>

> [@Rysto](#):
>
> Yeah, no. Not a chance. Have you ever actually turned on those checks on a serious program? Implicit integer conversions are endemic in C/C++. Eliminating them all in a real-world program simply isn’t plausible. If you were to try to use the checks to find time\_t conversion errors you’d drown in the noise.
> 
> What will probably happen is that compilers or static type checkers will have a special case for warning specifically about converting time\_t to other integer types.

Well, I don’t know how serious, but yes…

I recently ported some embedded code (tens of thousands of lines) from an 8-bit system to a POSIX 64-bit system.  
And, there were hundreds of type errors, and I fixed them all.

And, it took a long time.

---

<div class="post-metadata">

**Author:** ![Peter\_Morris](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/peter_morris/32/359_2.png) [@Peter\_Morris](https://boards.straightdope.com/u/Peter_Morris)\
**Post date:** [May 29, 2018, 1:57pm UTC](https://boards.straightdope.com/t/y1-8k/814987/30 "2018-05-29T13:57:42Z")

</div>

> [@Tim\_R.Mortiss](#):
>
> I studied programming way back in the seventies. Even then, we were taught not to use two digits for a year. We were taught to use [Julian Dates](https://en.wikipedia.org/wiki/Julian_day) to represent times, dates, and durations, which are number of days since an arbitrary date in pre-history. This makes any sort of Y2K issue irrelevant. I never had a single worry about Y2K because I assumed all programmers were taught this.

Yes, people were told this back in the 70’s. The trouble is they often had to write software so that it would work with legacy data. Records from last year were still needed, and they used 2 digit dates. So the new system had to understand 2 digit dates. Correcting the problem would involve a lot of extra work, and wouldn’t matter for another 25 years, so why bother? Three updates later, they still have to use 2 digit dates.

---

<div class="post-metadata">

**Author:** ![Tim\_R.Mortiss](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/tim_r.mortiss/32/142_2.png) [@Tim\_R.Mortiss](https://boards.straightdope.com/u/Tim_R.Mortiss)\
**Post date:** [May 29, 2018, 3:17pm UTC](https://boards.straightdope.com/t/y1-8k/814987/31 "2018-05-29T15:17:29Z")

</div>

> [@Peter\_Morris](#):
>
> Yes, people were told this back in the 70’s. The trouble is they often had to write software so that it would work with legacy data. Records from last year were still needed, and they used 2 digit dates. So the new system had to understand 2 digit dates. Correcting the problem would involve a lot of extra work, and wouldn’t matter for another 25 years, so why bother? Three updates later, they still have to use 2 digit dates.

Fair enough. I never actually \*worked \*as a programmer, so I don’t know what the professional practice was. I’ll stand corrected.

---

<div class="post-metadata">

**Author:** ![davidm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/davidm/32/225_2.png) [@davidm](https://boards.straightdope.com/u/davidm)\
**Post date:** [May 29, 2018, 4:16pm UTC](https://boards.straightdope.com/t/y1-8k/814987/32 "2018-05-29T16:16:27Z")

</div>

> [@Rysto](#):
>
> Yeah, no. Not a chance. Have you ever actually turned on those checks on a serious program? Implicit integer conversions are endemic in C/C++. Eliminating them all in a real-world program simply isn’t plausible. If you were to try to use the checks to find time\_t conversion errors you’d drown in the noise.
> 
> What will probably happen is that compilers or static type checkers will have a special case for warning specifically about converting time\_t to other integer types.

That will only find conversions and comparisons involving time\_t. Code that only uses ints wouldn’t be caught, and no doubt there’s some out there.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [May 29, 2018, 4:38pm UTC](https://boards.straightdope.com/t/y1-8k/814987/33 "2018-05-29T16:38:33Z")

</div>

Around 1980, I reviewed some date-handling code that a colleague had written. His leap year check correctly said that century years are not leap years but didn’t account for the 400-year exception, so it would have said that 2000 was not a leap year. I corrected this, but we both had a chuckle about the idea of our software still being used 20 years from now. Software changes so fast that (some) programmers (certainly not me!), when faced with the choice of doing something simple which may break in 20 or 30 years or doing it correctly but in a more complex way, may think “This code is not still going to be running 20 years from now, so it’s not worth worrying about problems that will only occur in the far future; furthermore, if the code is still in use, someone will be maintaining it and they can deal with the problem.”

ETA: As it happens, that company went out of business well before 2000.

---

<div class="post-metadata">

**Author:** ![Telemark](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/telemark/32/372_2.png) [@Telemark](https://boards.straightdope.com/u/Telemark)\
**Post date:** [May 29, 2018, 5:15pm UTC](https://boards.straightdope.com/t/y1-8k/814987/34 "2018-05-29T17:15:19Z")

</div>

[https://www-users.cs.york.ac.uk/susan/joke/decly.htm](https://www-users.cs.york.ac.uk/susan/joke/decly.htm)

At my company in the 80’s we were thinking about date formats.

---

<div class="post-metadata">

**Author:** ![markn\_1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@markn\_1](https://boards.straightdope.com/u/markn_1)\
**Post date:** [May 30, 2018, 2:40pm UTC](https://boards.straightdope.com/t/y1-8k/814987/35 "2018-05-30T14:40:20Z")

</div>

I bet a lot of software has been and is still written using the simple “divisible by 4 = leap year” rule. This works between 1901 and 2099 but will fail in 2100. Beware the Y2100 catastrophe!

---

<div class="post-metadata">

**Author:** ![whitetho](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/whitetho/32/1059_2.png) [@whitetho](https://boards.straightdope.com/u/whitetho)\
**Post date:** [June 2, 2018, 6:53pm UTC](https://boards.straightdope.com/t/y1-8k/814987/36 "2018-06-02T18:53:10Z")

</div>

> [@markn\_1](#):
>
> ETA: As it happens, that company went out of business well before 2000.

In the 1980s I worked for a bank which saved the year as an 8-bit offset from 1900, which could handle dates up to 2026. They also resolved the issue by going out of business, due to the savings and loan crises.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [June 2, 2018, 7:37pm UTC](https://boards.straightdope.com/t/y1-8k/814987/37 "2018-06-02T19:37:07Z")

</div>

This reminds me of the Doper with a vehicle clock that’s been doing wonky things for a while. (Maybe from a leap day goof.)

Can’t find it apparently without knowing more, like a username.

Anyone? Bueller? Bueller?

---

<div class="post-metadata">

**Author:** ![davidm](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/davidm/32/225_2.png) [@davidm](https://boards.straightdope.com/u/davidm)\
**Post date:** [June 2, 2018, 7:44pm UTC](https://boards.straightdope.com/t/y1-8k/814987/38 "2018-06-02T19:44:25Z")

</div>

> [@ftg](#):
>
> This reminds me of the Doper with a vehicle clock that’s been doing wonky things for a while. (Maybe from a leap day goof.)
> 
> Can’t find it apparently without knowing more, like a username.
> 
> Anyone? Bueller? Bueller?

https%3A%2F%2Fboards%2Estraightdope%2Ecom%2Fsdmb%2Fshowthread%2Ephp%3Ft%3D643968

---

<div class="post-metadata">

**Author:** ![k9bfriender](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/k9bfriender/32/3283_2.png) [@k9bfriender](https://boards.straightdope.com/u/k9bfriender)\
**Post date:** [June 2, 2018, 7:56pm UTC](https://boards.straightdope.com/t/y1-8k/814987/39 "2018-06-02T19:56:58Z")

</div>

> [@Telemark](#):
>
> As mentioned above, the Year 2038 problem has been addressed for most major systems already. It got a lot of attention during Y2K and plans were put in place to fix it back then.

A 64 bit counter only pushes the problem back, though. Somewhere around the year 3,000,000,000,000, we will just run into the same problem all over again.

We need to start thinking long term.

---

<div class="post-metadata">

**Author:** ![ftg](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/ftg/32/2801_2.png) [@ftg](https://boards.straightdope.com/u/ftg)\
**Post date:** [June 2, 2018, 9:00pm UTC](https://boards.straightdope.com/t/y1-8k/814987/40 "2018-06-02T21:00:15Z")

</div>

> [@davidm](#):
>
> https%3A%2F%2Fboards%2Estraightdope%2Ecom%2Fsdmb%2Fshowthread%2Ephp%3Ft%3D643968

Yep, thanks. That’s it.

Fixed [link](https://boards.straightdope.com/sdmb/showthread.php?t=643968).

A Feb. 28+ like error. But looks like it got reset and may not be tracked anymore.

Anyway, an example of how various date errors still crop up. Didn’t Apple have a problem a couple years ago bricking some devices due to a date overflow in an OS upgrade?

[Previous page](https://boards.straightdope.com/t/y1-8k/814987.md?page=1)

[Next page](https://boards.straightdope.com/t/y1-8k/814987.md?page=3)
