|
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.
|
|
|
|
|
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
cheers
Chris Maunder
|
|
|
|
|
|
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
|
|
|
|
|
Absolutely, I agree. I alwys use '2022-07-03' OR '2022/07/03'. Different separator, same meaning.
|
|
|
|
|
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
|
|
|
|
|
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.
|
|
|
|
|
Yeah but the great thing with standards and conventions are that there are so many to choose from.
cheers
Chris Maunder
|
|
|
|
|
|
Looks like these days global hunger is not big of a problem anymore.
|
|
|
|
|
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
|
|
|
|
|
yyyy-MM-dd for dates. But I don't run the USA, or even the world. ISO 8601
I've worked on systems where they've adopted (invented?) MM-dd-yyyy and MM-dd-yy.
Emphasis: using dashes, not slashes "MM/dd/yy", nor "dd/mm/YY".
I don't think those are used anywhere but in a legacy developer's fanciful invention. It's a nuisance for new work, and it's so baked-in that it's unlikely to ever be fixed.
Guaranteed to be incompatible with any country's format (ref Date format by country - Wikipedia[^]
|
|
|
|
|
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
|
|
|
|
|
<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 . 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;
|
|
|
|
|
|
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.
"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 .
Software Zen: delete this;
|
|
|
|
|
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 ing 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...
MM/DD/YY
Did you ever see history portrayed as an old man with a wise brow and pulseless heart, weighing all things in the balance of reason?
Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful?
--Zachris Topelius
|
|
|
|
|
I think your computer may have the Atari Centipede virus.
Beware of spiders, fleas and scorpions!
|
|
|
|