• Vexillologist Sheldon Cooper (unregistered)

    FRIST - And for all that are not familiar with the flag of India: the middle stripe is white, not black.

  • (nodebb)

    Matthew S. is up against a zero date, but instead of the UNIX epoch (1 Jan 1970), the date is zero relative to the NTFS epoch, 1 Jan 1601.

    Jonathan, I think, is up against "twelve months is a year and a year is 365 days" which fails if there's a February 29 in the twelve months, where the twelve months is a year and a year is 366 days. 366 > 365, so it can't be twelve months. It's severely lame, given that leap years happen (in our lifetimes) every four years...

  • (nodebb)

    Yeah, spoiler: Just use UTC and you can forget about all that nonsense like time zones and daylight savings. Most languages have support of UTC, if your language doesn't time to switch to something that does.

  • Jonathan (unregistered) in reply to Steve_The_Cynic

    100% correct on mine.

  • (nodebb) in reply to MaxiTB

    "Just use UTC"... Unless you're expecting your users to do the timezone conversion for you (as if they're less likely to make mistakes than the well-tested code in your langauge's standard library...) or all your users are in UTC+0 and don't use DST (which leaves you with West Africa and a few altantic islands), you will always need to deal with local timezones. Even the "store everything in UTC and convert for display" strategy is more complex than you think; users generally don't want their alarm clock going off at the wrong time when they travel or switch in/out of DST for example...

    Also, UTC still has leap years, which is what today's post was mainly about...

  • Sou Eu (unregistered)

    Dark theme country flag images do make sense. The flags in the article are drawn with a slight wave. A dark theme country flag image would use a dark color as the transparent background, allowing for a more pleasant dithering.

  • Fred Fredstone (unregistered)

    Can someone explain the last one?

  • (nodebb) in reply to Fred Fredstone

    The Indian flag doesn't have a black middle stripe... (And the bottom green stripe is normally significantly darker than suggested in the screenshot.)

  • (nodebb) in reply to mallard

    your users to do the timezone conversion

    Not sure what you mean by that, I think you confuse presentation layer with the business layer. Yes, end-user facing will show the time for whatever the use has selected, but this is a presentation layer conversion ;-)

    you will always need to deal with local timezones

    Again, this is a presentation layer issue. And you can convert every time for every calendar from UTC to whatever weird time zone there might be, current and historic, but you can not always do the same in reverse. Not only because daylight saving causes gaps&duplicates but also because some calendars do the same. So you need never ever have to deal with time zones, only on the presentation layer and that's a simple one-liner in most languages.

    strategy is more complex than you think

    No it's not. It's a simple one-liner on in the presentation layer and you need to do nothing in the business layer. Also nearly all transport protocols use UTC as a default, so you don't need to change anything in your exchange layer. And obviously there is to my knowledge not a single database which supports time zones (at best case mostly useless offsets), so you don't need to do anything. UTC is by far the simplest way to handle date/time and it's the only way how you can solve business transactions reliable internationally. And yes, I have worked for clients which lost every year millions because of daylight savings, not using UTC is a silent super expensive mistake because as long as you don't have someone time zone problem aware in your software team, those mistakes are rarely discovered.

    users generally don't want their alarm clock going off at the wrong time when they travel or switch in/out of DST for example

    Again, presentation layer vs business layer. Besides, I have traveled to over 100 countries so far, I always use UTC over local time zones, because you can't believe how often businesses get their own time zones wrong ;-).

  • Oleksii (unregistered)

    But you can have a dark mode coutry flag actually, for example in Ukraine it is almost official 'dark times' red/black instead of blue/yellow...

  • Strahd Ivarius (unregistered)

    I hate people implementing date management and forgetting how to differentiate between data stored and data presented. In a case not too long ago, one server was setup with an Australian time zone, another one with a Californian one, service accounts for the application were using something different, all for a customer located in Europe... Of course the requirement was to store EVERYTHING in ISO format, using UTC as the timezone, so they kept getting time offsets up to the moment a customer representative put his foot down (menacing to stop the project altogether) and required that everything was setup the same way.

    (and by the way, the NTFS epoch is 1601-01-01T00:00:00Z, for a value that is stored as the number of 100-nanoseconds since that day; lovely idea, Microsoft...)

  • (nodebb)

    Everything you say there @MaxiTB is true. And irrelevant.

    We're looking at presentation layer glitches. They might stem from business layer use of non-UTC, or they might stem from plain old "calendars are hard" problems and shitty libraries and/or roll-your-own date handling. Said shitty libraries and roll-your-owns can have plenty of WTFs and bugs around the corner cases. And something that shows up every four years for just 24 hours is a pretty decent corner case.

    With good well-factored code and a good test harness correctness gets pretty easy. But if everybody did that this website would die for lack of material.

  • (nodebb)

    The dark-mode flags one at the bottom is more interesting to me for there being one goofed up flag out of three.

    Roughly speaking, the actual Indian flag is orange on top, white in the middle, and green on the bottom. The flag we see is orange, black, and white.

    How did they get one of the three Indian flag colors right and two wrong? Including subbing black for white, while also getting the white of the US & UK flags right? And their reds and blues right?

    I am not able rightly to apprehend the kind of confusion ...

  • Anonymous Coward (unregistered) in reply to Sou Eu

    Roughly speaking, the actual Indian flag is orange on top, white in the middle, and green on the bottom. The flag we see is orange, black, and white.

    If you lock closely I believe the flag in that image is orange, black, and pale green (E7FFE7 or thereabouts). Maybe they've tried to invert the brightness in the flag while preserving the hue, and the orange is approximately unchanged because it's close to 50% brightness?

    The dark-mode flags one at the bottom is more interesting to me for there being one goofed up flag out of three.

    Well, if you want a really out-there theory: some countries' air forces do use something like a dark-mode flag: a "low-visibility roundel", a monochrome or faded version of the air force's usual roundel symbol. The US and UK have these. As far as I can tell India does not. But that shouldn't have any impact on how any of their flags are displayed.

  • Erk (unregistered) in reply to Steve_The_Cynic

    I once saw code (would be posted here if I could relocate it) that calculated people's age as days since birth divided by 360 :O

    And this was not the shop on the corner...

  • Chris (unregistered)

    TRWTF is Microsoft Polish. To a native speaker of Polish, the single untranslated line makes a whole lot more sense than the word salad produced by Microsoft’s godawful (yet probably human) translators. It’s full of broken grammar, they translated "tenant" as "lease", and it is the return of the famously wrong "Register" ("Zarejestruj") translation of "Sign in".

  • Ryan S (unregistered)

    YES! I noticed the flag issue this week too! There are so many wrong, but of course not USA - we're far too narcissistic to miss that!

  • stevediaz (unregistered)

    thanks for sharing

  • (nodebb)

    On the last one, I found it interesting that while the USA kept its English initialism in this German country list, the UK was fully translated instead of treating the two consistently as USA/UK or VS/VK.

  • Viz Travels (unregistered)
    Comment held for moderation.

Leave a comment on “Time for more leap'd years”

Log In or post as a guest

Replying to comment #:

« Return to Article