Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. We're not all in the US: Annual rant about dates

We're not all in the US: Annual rant about dates

Scheduled Pinned Locked Moved The Lounge
databasecloudjsonquestion
67 Posts 40 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C 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

    G Offline
    G Offline
    Gary Wheeler
    wrote on last edited by
    #38

    **<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;

    K 1 Reply Last reply
    0
    • G GuyThiebaut

      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

      C Offline
      C Offline
      Chris Maunder
      wrote on last edited by
      #39

      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

      1 Reply Last reply
      0
      • C 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

        D Offline
        D Offline
        Dan Neely
        wrote on last edited by
        #40

        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|

        E 1 Reply Last reply
        0
        • R RooN3y

          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

          C Offline
          C Offline
          Chris Maunder
          wrote on last edited by
          #41

          RooN3y wrote:

          But I don't want to blame Linux. Stupid AWS

          :laugh:

          cheers Chris Maunder

          1 Reply Last reply
          0
          • I Indivara

            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:

            C Offline
            C Offline
            Chris Maunder
            wrote on last edited by
            #42

            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

            1 Reply Last reply
            0
            • C Cpichols

              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?

              C Offline
              C Offline
              Chris Maunder
              wrote on last edited by
              #43

              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

              C 1 Reply Last reply
              0
              • P PSU Steve

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

                C Offline
                C Offline
                Chris Maunder
                wrote on last edited by
                #44

                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

                1 Reply Last reply
                0
                • B Bruce Patin

                  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.

                  C Offline
                  C Offline
                  Chris Maunder
                  wrote on last edited by
                  #45

                  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

                  1 Reply Last reply
                  0
                  • C 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

                    K Offline
                    K Offline
                    Kirk 10389821
                    wrote on last edited by
                    #46

                    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.

                    1 Reply Last reply
                    0
                    • C Chris Maunder

                      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

                      C Offline
                      C Offline
                      Cpichols
                      wrote on last edited by
                      #47

                      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.

                      C 1 Reply Last reply
                      0
                      • M Mike Winiberg

                        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(

                        C Offline
                        C Offline
                        Cpichols
                        wrote on last edited by
                        #48

                        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.

                        1 Reply Last reply
                        0
                        • C 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

                          K Offline
                          K Offline
                          kmoorevs
                          wrote on last edited by
                          #49

                          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"

                          1 Reply Last reply
                          0
                          • G Gary Wheeler

                            **<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;

                            K Offline
                            K Offline
                            kmoorevs
                            wrote on last edited by
                            #50

                            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"

                            G 1 Reply Last reply
                            0
                            • K kmoorevs

                              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"

                              G Offline
                              G Offline
                              Gary Wheeler
                              wrote on last edited by
                              #51

                              Actually he's a sharp guy, he just didn't have a pressing need for the date/time values.

                              Software Zen: delete this;

                              K 1 Reply Last reply
                              0
                              • G Gary Wheeler

                                Actually he's a sharp guy, he just didn't have a pressing need for the date/time values.

                                Software Zen: delete this;

                                K Offline
                                K Offline
                                kmoorevs
                                wrote on last edited by
                                #52

                                My apologies to your colleague for being presumptuous. :rose:

                                "Go forth into the source" - Neal Morse "Hope is contagious"

                                G 1 Reply Last reply
                                0
                                • K kmoorevs

                                  My apologies to your colleague for being presumptuous. :rose:

                                  "Go forth into the source" - Neal Morse "Hope is contagious"

                                  G Offline
                                  G Offline
                                  Gary Wheeler
                                  wrote on last edited by
                                  #53

                                  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;

                                  1 Reply Last reply
                                  0
                                  • C 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

                                    S Offline
                                    S Offline
                                    SeattleC
                                    wrote on last edited by
                                    #54

                                    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.

                                    1 Reply Last reply
                                    0
                                    • C Charles Gallo

                                      At least we don't use stones for people, MPH for speed limits while distances are in Km

                                      A Offline
                                      A Offline
                                      Alister Morton
                                      wrote on last edited by
                                      #55

                                      Where's that? Here in the UK, road sign distances are in miles and speed limits are in MPH.

                                      1 Reply Last reply
                                      0
                                      • R RooN3y

                                        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

                                        E Offline
                                        E Offline
                                        englebart
                                        wrote on last edited by
                                        #56

                                        Hear,hear!

                                        1 Reply Last reply
                                        0
                                        • D Dan Neely

                                          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|

                                          E Offline
                                          E Offline
                                          englebart
                                          wrote on last edited by
                                          #57

                                          I think your computer may have the Atari Centipede virus. Beware of spiders, fleas and scorpions!

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups