We're not all in the US: Annual rant about dates
-
That's the tip of the iceberg. When you start getting to points in time and calculating between different points in time it becomes even more of a pain - then some developer decided to save dates without a timezone because "why would anyone ever need to know the timezone?" Dates are perhaps one of the biggest PITAs in data.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
Our dirty secret is we store times as local timezone and we've had an outstanding TODO from about 14 years ago to convert all of them to UTC. Generally pretty easy - just add 5hrs. Except we have to take into account daylight saving. For every year. And then you have to be careful about the boundary times and the order in which you update. And then your head hurts and you look at the other things on your TODO and think "dates work. Let's not stir the hornets' nest"
cheers Chris Maunder
-
Why is it that so many sites - the latest being AWS's portal - refuse to understand that the only country in the world that uses MM/DD as a date format is the US. OK, and Belize. And Canadians when they are being accomodating and polite. But no one else. The rest of the world is looking at 07/03 thinking "7th of March?". I honestly don't understand why companies do this other than they straight out don't realise no one else does does dates like this. I've banned ambiguous dates at CodeProject and DeveloperMedia because when we need to get dates nailed down and the conversation includes an American, a Canadian and an Australian (not walking into a bar) the conversation falls apart quickly if we can't trust the date that's been written on the contract. Can we please, each of us, take a quick look at our code and maybe, just maybe, rethink how dates are presented. Here are some options: - IF you're tight on space then 3Jul is better than 03/07 and 07/03. And sure, we then run into language issues, but if your site is predominately english then your readers have far bigger issues. - 2022-07-03 is universal. Everyone gets that, even SQL. - 3-Jul-2022 is friendly and obvious. 3-Jul-'22 is shorter if you really need s pace. - 1656806400000 is accurate, unambiguous, precise to the millisecond. And fairly useless. Don't do this.
cheers Chris Maunder
Chris Maunder wrote:
Can we please, each of us, take a quick look at our code and maybe, just maybe, rethink how dates are presented.
I've done this numerous times, and always reached similar conclusions to yours. The problem is ignoranus :elephant:ing :sunshine: clients, who refuse to acknowledge the existence of users from outside the US (in rare cases this has actually been a valid assumption) and insist on formatting it at 07/03 because that's the way they learned while snacking on crayons and paint chips, and anything else is too confusing or too hard or too weird or too... X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X|
-
Feel your pain with AWS. We have to set the culture code at the start of every Lambda we have because our main website sends dates in the british dd/mm/yyyy format and lambdas default to US format regardless of the region. The first 2 weeks of January where fun! I'm blaming AWS but to be honest it's probably the Linux image they use to spin up the lambda. But I don't want to blame Linux. Stupid AWS
RooN3y wrote:
But I don't want to blame Linux. Stupid AWS
:laugh:
cheers Chris Maunder
-
I was under the impression that epoch dates were unambiguous until I came across those that weren't. Apparently there are so many different versions of those too :sigh: [Epoch (computing) - Wikipedia](https://en.wikipedia.org/wiki/Epoch\_(computing)) On a side note, "rationale for selection" on that page is blank for Unix epoch. I guess someone just pulled that year out of you-know-where :rolleyes:
Yes - I was bitten by that the other week. Garmin, for example, bases its epoch on the day the company was born. I'm not saying they have a alightly skewed notion of their importance in the universe or anything, but...
cheers Chris Maunder
-
American here. I agree that we need to resolve this date issue to something unambiguous, but I have a question:
Quote:
2022-07-03 is universal. Everyone gets that, even SQL.
... which is yyyy-mm-dd, right? Could/should we say that SQL is siding with the US on this one? I mean ... everyone adapts nicely to SQL dates, right?
In my view heirarchical values like dates (or versions, or taxonomies etc) should be ordered in increasing or decreasing order, but never both. So year -> month -> day or day -> month -> year but never, ever, ever month -> day -> year. I don't think SQL is siding with anything other than a format that efficiently sorts. Not that SQL sorts dates based on a string representation...
cheers Chris Maunder
-
Julian dates all the way! 15-Jul-2022 = 2022-196 or 22196. Julian Date Converter - Longpela Expertise[^] I actually worked on an application back in the 90's where dates were tracked as Julian dates. Was a US Air Force transportation system and data records all had to fit in lines of 80 characters. Julian dates saved us one character. :)
There is a large company I talk with regularly who shall remain unnamed who constantly refer to week numbers when talking dates. But not "week 1 = first week of January", but "week 1 = first week of their financial year". No one understands what they mean except them. It's like a traffic accident. I just watch with my mouth agape.
cheers Chris Maunder
-
I once had to present dates on an 80-character green screen terminal and chose 03Jul22 as the shortest but most understandable form to all countries.
We use dd-MMM-yy but I still worry it's ambiguous. I played with dd-MMM-'yy to clarify but it just didn't seem right.
cheers Chris Maunder
-
Why is it that so many sites - the latest being AWS's portal - refuse to understand that the only country in the world that uses MM/DD as a date format is the US. OK, and Belize. And Canadians when they are being accomodating and polite. But no one else. The rest of the world is looking at 07/03 thinking "7th of March?". I honestly don't understand why companies do this other than they straight out don't realise no one else does does dates like this. I've banned ambiguous dates at CodeProject and DeveloperMedia because when we need to get dates nailed down and the conversation includes an American, a Canadian and an Australian (not walking into a bar) the conversation falls apart quickly if we can't trust the date that's been written on the contract. Can we please, each of us, take a quick look at our code and maybe, just maybe, rethink how dates are presented. Here are some options: - IF you're tight on space then 3Jul is better than 03/07 and 07/03. And sure, we then run into language issues, but if your site is predominately english then your readers have far bigger issues. - 2022-07-03 is universal. Everyone gets that, even SQL. - 3-Jul-2022 is friendly and obvious. 3-Jul-'22 is shorter if you really need s pace. - 1656806400000 is accurate, unambiguous, precise to the millisecond. And fairly useless. Don't do this.
cheers Chris Maunder
I am stateside, and I really encourage people to use: YYYYMMDD as much as possible. Especially for filename prefixes. it's awesome, because it sorts wonderfully (sequentially), and is unambiguous. Having spent a lifetime with Oracle, I use 03-Jul-22 a LOT, as in code comments, etc. I feel your pain.
-
In my view heirarchical values like dates (or versions, or taxonomies etc) should be ordered in increasing or decreasing order, but never both. So year -> month -> day or day -> month -> year but never, ever, ever month -> day -> year. I don't think SQL is siding with anything other than a format that efficiently sorts. Not that SQL sorts dates based on a string representation...
cheers Chris Maunder
S0, for July 3, 07/03 is okay by this standard, though 07/03/2022 would not be? Or 22/07/03 would work? As you suggested, maybe numbers should never be used for months in scheduling, because changing decades-old conventions never ends in anything but confusion. Jul3,22 | 3Jul,22 | 3Jul22 - none of these will end in confusion.
-
As I've said elsewhere hereabouts - in over 40 years of writing software, the handling of dates has been the biggest single problem I have had to tackle. It's staggering that after all these years, date handling is still a (mostly lost, incorrect and misunderstood) black art to almost all software systems, including date handling libraries, developer frameworks and just about every piece of end user software and web page you come across. 8(
We just collect month, day, and year as separate data values and assemble them in processing, but that's mostly birth dates, so the calendar inputs are mostly an aggravation instead of a convenience. Another simple solution would be to make an onchange that adds a note containing the long-form of the entered date, or force the use of the calendar input.
-
Why is it that so many sites - the latest being AWS's portal - refuse to understand that the only country in the world that uses MM/DD as a date format is the US. OK, and Belize. And Canadians when they are being accomodating and polite. But no one else. The rest of the world is looking at 07/03 thinking "7th of March?". I honestly don't understand why companies do this other than they straight out don't realise no one else does does dates like this. I've banned ambiguous dates at CodeProject and DeveloperMedia because when we need to get dates nailed down and the conversation includes an American, a Canadian and an Australian (not walking into a bar) the conversation falls apart quickly if we can't trust the date that's been written on the contract. Can we please, each of us, take a quick look at our code and maybe, just maybe, rethink how dates are presented. Here are some options: - IF you're tight on space then 3Jul is better than 03/07 and 07/03. And sure, we then run into language issues, but if your site is predominately english then your readers have far bigger issues. - 2022-07-03 is universal. Everyone gets that, even SQL. - 3-Jul-2022 is friendly and obvious. 3-Jul-'22 is shorter if you really need s pace. - 1656806400000 is accurate, unambiguous, precise to the millisecond. And fairly useless. Don't do this.
cheers Chris Maunder
Chris Maunder wrote:
2022-07-03 is universal. Everyone gets that, even SQL.
:thumbsup: I couldn't agree more! This is what I use everywhere I have a choice. As someone else already mentioned, the sorting works with no special effort. :)
"Go forth into the source" - Neal Morse "Hope is contagious"
-
**<OldFartWarStory>**
I rewrote a part of our application that generated a comma-separated value log for import into Excel. Instead of writing a human-readable date the Excel understand, the previous version wrote an integer. As it turns out, that integer was the number of seconds between January 1, 1900 00:00:00 and today's date at 00:00:00. To make matters worse, the time was a floating point value between 0.0 and 1.0, representing the time of day. After reverse engineering all this crap, I casually mentioned this to the engineer who used the log. He also took over for someone now departed. He told me that he never understood how the date and time values in the log worked, and didn't pay too much attention to them :doh: . I quietly showed him how to format the columns in the Excel spreadsheet as 'Date' and 'Time', and drank my dinner that evening.**</OldFartWarStory>**
Software Zen:
delete this;
I can relate! One popular POS system we integrate with uses Julian dates (int number of days since 1900-01-01) everywhere in their db. It was a bit strange at first, but easily solved via dateadd. :)
Gary Wheeler wrote:
he never understood how the date and time values in the log worked, and didn't pay too much attention to them
:wtf: :omg: :| Not much of an engineer then huh?
"Go forth into the source" - Neal Morse "Hope is contagious"
-
I can relate! One popular POS system we integrate with uses Julian dates (int number of days since 1900-01-01) everywhere in their db. It was a bit strange at first, but easily solved via dateadd. :)
Gary Wheeler wrote:
he never understood how the date and time values in the log worked, and didn't pay too much attention to them
:wtf: :omg: :| Not much of an engineer then huh?
"Go forth into the source" - Neal Morse "Hope is contagious"
Actually he's a sharp guy, he just didn't have a pressing need for the date/time values.
Software Zen:
delete this;
-
Actually he's a sharp guy, he just didn't have a pressing need for the date/time values.
Software Zen:
delete this;
-
My apologies to your colleague for being presumptuous. :rose:
"Go forth into the source" - Neal Morse "Hope is contagious"
Oh trust me, there are plenty of engineers here who can create documentation in any app you like, as long as it's Excel :doh: .
Software Zen:
delete this;
-
Why is it that so many sites - the latest being AWS's portal - refuse to understand that the only country in the world that uses MM/DD as a date format is the US. OK, and Belize. And Canadians when they are being accomodating and polite. But no one else. The rest of the world is looking at 07/03 thinking "7th of March?". I honestly don't understand why companies do this other than they straight out don't realise no one else does does dates like this. I've banned ambiguous dates at CodeProject and DeveloperMedia because when we need to get dates nailed down and the conversation includes an American, a Canadian and an Australian (not walking into a bar) the conversation falls apart quickly if we can't trust the date that's been written on the contract. Can we please, each of us, take a quick look at our code and maybe, just maybe, rethink how dates are presented. Here are some options: - IF you're tight on space then 3Jul is better than 03/07 and 07/03. And sure, we then run into language issues, but if your site is predominately english then your readers have far bigger issues. - 2022-07-03 is universal. Everyone gets that, even SQL. - 3-Jul-2022 is friendly and obvious. 3-Jul-'22 is shorter if you really need s pace. - 1656806400000 is accurate, unambiguous, precise to the millisecond. And fairly useless. Don't do this.
cheers Chris Maunder
Perhaps it's because we're conforming to the international standard, ISO 8601, that uses the format yyyy-mm-dd and we just shortened it to mm-dd. Of course, it might also be that we just don't care, and people who want to use the web sites we build just have to figure out which of the many nonstandard date/time formats we're using. When we really want to piss you off, we also use the English month names, for no better reason than because the site uses English. So don't push us or we'll switch to the Mayan calendar. Grrrr. Really, if that's the worst complaint you have about AWS, you are a pretty satisfied customer.
-
At least we don't use stones for people, MPH for speed limits while distances are in Km
Where's that? Here in the UK, road sign distances are in miles and speed limits are in MPH.
-
Feel your pain with AWS. We have to set the culture code at the start of every Lambda we have because our main website sends dates in the british dd/mm/yyyy format and lambdas default to US format regardless of the region. The first 2 weeks of January where fun! I'm blaming AWS but to be honest it's probably the Linux image they use to spin up the lambda. But I don't want to blame Linux. Stupid AWS
-
Chris Maunder wrote:
Can we please, each of us, take a quick look at our code and maybe, just maybe, rethink how dates are presented.
I've done this numerous times, and always reached similar conclusions to yours. The problem is ignoranus :elephant:ing :sunshine: clients, who refuse to acknowledge the existence of users from outside the US (in rare cases this has actually been a valid assumption) and insist on formatting it at 07/03 because that's the way they learned while snacking on crayons and paint chips, and anything else is too confusing or too hard or too weird or too... X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X| X|
-
Remember, this is the same country that is still using the English system of measures, when almost everywhere else we use the Metric system... It is as if there is a need to proclaim that they are not like anyone else, all the time....
To correct your misunderstanding of the US, we do (and have) used both English and metric. I, like other kids of my generation, learned both in high school back in the 1960s. And I was raised in a small town/rural area. Americans really have no issue using both and switching between them.