• 516052 (unregistered)

    To be fair, using a short to represent the year component in a date object makes sense. It's not like you'll ever need more than 8 bits of year. So this is less of a WTF and more of a Oh, neat.

  • (nodebb) in reply to 516052

    I think you meant 16 bits. 8 bits would allow only 256 possible values which while probably good enough for the lifetime of many systems, definitely feels needlessly risky.

  • (nodebb)

    As a non-American, the real WTF is the MM/DD/YYYY date format.

  • (nodebb)

    What a "weak" solution!

  • Tim (unregistered)

    Is that the same "Progress" 4GL I used in 1991 I wonder?

  • Flabberguest (unregistered)

    I may be missing something, but in the roll-over case the results would be "backwards", wouldn't they? The week number should always be on the left side of the subtraction, not on the right. The way it is, week 0 will result in week 26 (which is roughly ok), while week 26 yields week 0 of the previous year, which would be one and a half years ago?

  • (nodebb)

    Not sure if it's a mistake in Mirjam's memory, Remy's editing, or a real error in the original, but isn't 26 - v-weeknumber just plain wrong? If the start date is February 1, then week number is 5, and the result would be week number 21 (roughly mid-May). Unless 52 - 26 - v-weeknumber is right-associative, which would give the correct result but would be a definite language WTF.

    Addendum 2026-06-17 06:57: :hanzo:

  • 516052 (unregistered) in reply to Jonathan Lydall

    Indeed. My bad. I'd blame my years but that would just be a cliche.

  • MangusPI (unregistered) in reply to Jonathan Lydall

    Or rather, an actual WTF is non-Americans who cannot grasp the basic concept of their being more than one way to do things. Both formats have a place and logic behind them. This attitude of only yours being valid is frankly childish.

  • Hanzito (unregistered) in reply to Dragnslcr

    My thought exactly.

  • (nodebb) in reply to Jonathan Lydall

    And a reminder that there are different standards for week numbering
    https://en.wikipedia.org/wiki/Week#Other_week_numbering_systems
    noting that it seems USA uses two different ones.

  • (nodebb)

    OT: I bookmark comment pages I want to check on later, but TDWTFs comment page titles are all the same, so I have a single 'The Daily WTF: Curious Perver ...' bookmark. (And three with keyboard mash at the end.)

  • (nodebb)

    Agreed. Should probably be 52 - 26 + v-weeknumber

  • Pag (unregistered)

    The earliest possible date should be 01/01/-32768. It's either a copy-paste error or the person writing the docs is thinking the "most negative" value has to have the largest numbers possible. But even in negative years, January is still earlier than December.

  • Anonymous Coward (unregistered)

    I kinda don't hate the 52 - 26. Yes, it's mathematically unnecessary. But at a glance, I know exactly what's happening where I might have to think a sec if I saw 26 instead.

  • ttlanhil (unregistered) in reply to MangusPI

    As a non-American, yes, there are multiple ways to do dates. There's the international standard yyyy-mm-dd (which is ideal for a number of reasons) There's the older dd/mm/yyyy (you're scanning left to right and want to see date first - not as good, but okay) There's d/m/yy (or some mix of which fields are abbreviated) which isn't as good, and can sometimes cause problems, but if you want quick'n'dirty it's there...

    Then there's mm/dd/yyyy which never makes sense unless you grew up with both it and American exceptionalism. Try telling time as min:sec:hour and see how confusing that gets if you want middle-endian data. Note, if you instead do mon dd yyyy (e.g. July 4 2026) and you speak that way (i.e. you say "July 4" or "July 4th") then I'll accept that, in name form. But not numeric.

  • (nodebb) in reply to HXO

    There may be multiple week-numbering standards, but subtracting 26 (with wraparound) should be an OK way to go back half a year in all of them.

  • Joe (unregistered)

    Most of the people complaining about mm/dd/yyyy prefer to use dd/mm/yyyy which is funny because if you're on this site, you should know that yyyy/mm/dd is vastly superior because it can be sorted as a string and for the most part nobody gets confused about which component is the month and which is the day (some people will be confused no matter what).

  • Jaloopa (unregistered) in reply to Joe
    Comment held for moderation.

Leave a comment on “Weekly Calculated”

Log In or post as a guest

Replying to comment #700674:

« Return to Article