If Denis Norden didn't need to censor 'cockups', I don't think The Reg has to.
Developer’s code worked, but not in the right century
Why hello there Monday! And hello, therefore, to a new instalment of “Who, me?”, The Register’s column in which readers confess to their c*ckups. This week meet “Lars” who told us he once worked for “a large outsourcing company” that assigned him to do some work on a major supermarket chain’s loyalty card program. One of the …
COMMENTS
-
-
Monday 18th June 2018 07:33 GMT HPCJohn
Can someone explain to me ... why in the blue blazes would a supermarket have its own date format? I guess a database expert can explain.
But more importantly why is a format like that not documented and given to all developers?
I know it is not a comparable situation, but I have a great respect for ISO 9001 standards for documents. ISO standards might seem boring in the extreme. However there as a case of a person receiving a radiation overdose because the dose calculation was performed using a superseded document. Far more serious than loyalty points.
-
-
-
Monday 18th June 2018 17:23 GMT Mark 85
Re: Re : Can someone explain to me...
"Why this wasn't tested offline first before applying it to a LIVE database ?"
No test database?
That wasn't uncommon. Been there, done that and screwed up the "live" data base once... lesson learned. I didn't start seeing test databases until around 2000 due to the costs involved for storage, etc. In at least one case, it was the IT manager who felt that programmers were perfect and thus no need for one.
-
-
Monday 18th June 2018 19:02 GMT Anonymous Coward
Re: Re : Can someone explain to me...
> You think there's a test database when they did bit fiddling with the date format to save space?
A test database for the task at hand could be as small as one or two partial records, if need be.
That said, I am not criticising the person in question as I do not know the whole story.
-
-
-
Monday 18th June 2018 08:23 GMT H in The Hague
"... ISO standards might seem boring in the extreme."
I've now reached the age where I consider that far preferable to the wrong kind of excitement.
(Anyway, those standards mostly say: think about what you're doing, do it consistently, and make sure you can prove it - common sense really.)
-
Monday 18th June 2018 10:53 GMT Doctor Syntax
"those standards mostly say: think about what you're doing, do it consistently"
I'm not sure low level customer service agents are allowed to think what they're doing but consistency seems to matter, even if it's done badly. Once something goes wrong any complaint leads to the same wrong being repeated.
Newspapers often have a weekly column where a journalist manages to sort out various customer issues with big companies. Inevitably the problem has gone round a C/S loop several times without success, gets fixed as soon as it gets tackled out of loop and turns out to be some combination of "unique" and "computer" issue. The only thing unique was that it got handled by the company's press desk who needed a sensible answer. Up to then it had probably been handled strictly according to the C/S scripts with all the consistency that ISO 9000 and the like dictate. A few decades back the talk was of "empowering" C/S. That's been killed in the name of consistency.
-
-
-
Monday 18th June 2018 08:38 GMT Mage
Re: The Standard Date Format?
I do like YYYY MM DD HH MM SS. Not sure what the standard way to store is. The US printed format MM DD YYYY is a broken idea.
XKCD Standards
I think year 0 on computers should have been end of last Ice age in Ireland, or date of founding of first town in the world.
Two sizes of date / time object?
Big: Heat death of Universe with resolution of Planck time
Regular: Expected death of Earth due to Sun + 10 million years, resolution 1 millisecond.
Yes I know 2 digit year was to save storage and existing start dates are compromises. Many/most run out in less than possible existence of human species.
Three main issues:
Start date of storage
Format(s) of storage
Human readable formats, not just in Latin script, but all languages.
-
Monday 18th June 2018 11:24 GMT Mystereed
Re: The Standard Date Format?
"I do like YYYY MM DD HH MM SS. "
We had a bug in a script which did a very similar thing to what you did (and a very easy mistake for humans to make) - the log file showed all updates at 7 minutes past the hour, none for any other minute.
It was July - We needed to use MI instead of MM for the minutes mask :-)
-
Monday 18th June 2018 15:16 GMT jelabarre59
Re: The Standard Date Format?
Yes I know 2 digit year was to save storage and existing start dates are compromises. Many/most run out in less than possible existence of human species.
I had heard some systems in the 1960's had been programmed with *one* digit years. So there were a handful of cases of a "Year 1970 Bug". It should have been a clue that the problem might crop up again.
And as I remember, Business Basic used a *2-character* (not 2-digit) format for years, so you'd have to use a conversion table to manipulate it in outside code. Not that MAS90 was very friendly with outside-code (was a nightmare dealing with EDI and MAS90).
-
Monday 18th June 2018 09:16 GMT Stoneshop
What is The Standard Date Format?
Way back, when harddisks were Fscking Expensive, I inherited a record[0] catalog database for a library, written in Turbo Pascal. To save space on its very minimal 20MB harddisk, dates were coded as 5 bits day, 4 bits month, and 7 bits year counting from 1900, stored in a 16-bit word. That wasn't too bad, since the only date info used at that point were the date of purchase and maybe a date of retirement of the physical item. However, soon after I took over maintenance we decided to also use the database for recording transactions as well. For this a larger PC was acquired for the princely sum of a tick over Dfl.10000, with a 80MB disk, so space became less of a issue. As the database layout had to change anyway, I decided to store dates as Julian making it a no-brainer to calculate date differences (which one could consider somewhat crucial for a library).
[0] the vinyl and CD sort.
-
-
Monday 18th June 2018 09:42 GMT Hans 1
timestamp is a date format
@Katrinab
1. Nope, those are timestamps! They are usually [milli]seconds since, NOT days.
2. 2nd January 1904? (Mac) ? That was up until Mac OS 9 (aka 2000), Mac OS X and macOS use UNIX timestamps.
Maybe The Register can come up with its own special timestamp ? Milliseconds since el'Reg started ?
A date format is, for example, [joke]dd/MM/yyyy in the civilized and MM/dd/yyyy in the uncivilized world. Some heretics also like to use dd.MM.yyyy. l33ts use yyyyMMdd.[/joke]
-
Monday 18th June 2018 18:44 GMT Stoneshop
Re: timestamp is a date format
Maybe The Register can come up with its own special timestamp ? Milliseconds since el'Reg started ?
Sheepmarathons (the time required for a sheep at maximum velocity in vacuum to finish a marathon) (straight line, I expect it'll have some problems cornering at that speed).
That's 0.0070383633 seconds, to be exact.
-
Monday 18th June 2018 10:21 GMT Jonathan Richards 1
No standard for epochs - @katrinab
Those are epochs: the arbitrarily chosen t=0 point for the counter. Formats are the expression of dates in one's chosen calendar.
PS. In fact, Unix counts seconds since the epoch, hence the approaching Unix Time "Apocalypse".
-
Monday 18th June 2018 11:22 GMT Doctor Syntax
Re: No standard for epochs - @katrinab
Unix counts seconds since the epoch, hence the approaching Unix Time "Apocalypse"
From then link: "On January 19, 2038 03:14:08 GMT all computers that still use 32 bit Unix Time will overflow."
In 20 years time will there be anything outside of museums still using 32-bit Unix time?
-
Monday 18th June 2018 13:44 GMT David Nash
Re: No standard for epochs - @katrinab
"will there be anything outside of museums still using 32-bit Unix time?"
Of course there will. Some will be embedded or control systems built by suppliers who no longer exist. Those will be the big problems, because the users won't even be aware that a problem is coming.
-
Tuesday 19th June 2018 06:14 GMT onefang
Re: No standard for epochs - @katrinab
"In 20 years time will there be anything outside of museums still using 32-bit Unix time?"
In 20 years time I would not be surprised that a certain embedded 32 bit device I'm responsible for is still in use. In 19 years time, remind me to bring that up with the client.
-
Tuesday 19th June 2018 06:56 GMT druck
Re: No standard for epochs - @katrinab
Doctor Syntax wrote:
From then link: "On January 19, 2038 03:14:08 GMT all computers that still use 32 bit Unix Time will overflow."
Well it overflows a signed 32 bit number, which will affect a lot of incorrectly written software, but it will be another 68 years before it overflows an unsigned 32 bit number, and really is at the end of the road.
-
Monday 18th June 2018 16:53 GMT Antron Argaiv
Re: No standard for epochs - @katrinab
Unix counts seconds since the epoch, hence the approaching Unix Time "Apocalypse".
[Somewhere in a dusty corner of an otherwise deserted computer lab, two bearded men are hunched over a Teletype]
Ken: Date and time, what's it going to be?
Dennis: Some very large number, so that when it overflows, we won't be around.
Ken: UINT16?
Dennis: Better make it UINT32, that should be fine.
Ken: Right. That should be safe. By the time it rolls over, no one will ever remember UNIX.
-
-
-
Monday 18th June 2018 08:34 GMT Peter Prof Fox
Because computer dates are numbers but real dates aren't
Not yet. Unknown. Since before we started counting. And so on.
When did you move into your house? Come on! Come on! YYYY-MM-DD all the bits! I can only remember it was summer 1989. So 1989 is a perfectly valid real world date which isn't 1st Jan 1989.
Then you need to do sorting and calculations. What is 31st January plus one month? Does 4th August come 'before' or 'after' August? (Neither it is 'in'.) Nobody is sure when Chaucer was born (Roughly 1343) so do we use 'unknown' or wing-it with 1343. J.K. Rowling was born 31 July 1965 so that's fine but what goes in the died field? 'Not yet' which is different from 'unknown'.
More at http://vulpeculox.net/day/
-
Monday 18th June 2018 11:07 GMT Doctor Syntax
Re: Because computer dates are numbers but real dates aren't
Get into historical dates and you have more complications. Julian or Gregorian? Different countries switched at different times and the start of the year isn't necessarily the first of January. (Unix cal always starts with January. man cal, at least back in V7 days, listed that as a bug.)
Then you get documents with the year given as regnal years and/or the rest of the date relative to a church feast or saint's day. Such documents may relate to property.
-
Monday 18th June 2018 15:42 GMT Daedalus
Re: Because computer dates are numbers but real dates aren't
Julian or Gregorian?
You're confusing the Julian calendar with the Julian Day. The calendar is extinct, but the Julian day is used in various settings as a date that is the same across all calendars.
https://en.wikipedia.org/wiki/Julian_day
-
Monday 18th June 2018 19:48 GMT Doctor Syntax
Re: Because computer dates are numbers but real dates aren't
"You're confusing the Julian calendar with the Julian Day."
Oh no I'm not.
"The calendar is extinct"
Not if you're dealing with historical material. Just because you don't it doesn't mean that nobody else does. It's building in assumptions like that that lead to failures.
If you have a Unix-like system with TZ set to one of those for "England and its colonies" (to quote the original man entry) run
cal 1752
-
-
Wednesday 20th June 2018 20:37 GMT Jonathan Richards 1
Re: Because computer dates are numbers but real dates aren't
> cal 1752
[imagine a September where Wed 2 is followed by Thu 14]*
Really, that should be dependent on i10n; different countries switched from Julian to Gregorian calendars at different points in time (and hence with different adjustment days omitted). 1752 was the year Britain and its colonies got on board. Turkey held out until 1926.
*You have to imagine, because El Reg, he no let me paste monospaced typeface.
-
-
Tuesday 19th June 2018 02:49 GMT Olivier2553
Re: Because computer dates are numbers but real dates aren't
"The calendar is extinct
Not if you're dealing with historical material."
That does not make it less extinct. Like Latin is an extinct language, even if there are professors still teaching Latin.
I would also assume that historians are not much concerned about the way a computer may handle dates, it is not like your old manuscript is getting out of stock any soon.
-
-
-
-
-
-