PugJesus@lemmy.world to memes@lemmy.worldEnglish · 2 years agoThe last hopelemmy.worldimagemessage-square33linkfedilinkarrow-up1831arrow-down15
arrow-up1826arrow-down1imageThe last hopelemmy.worldPugJesus@lemmy.world to memes@lemmy.worldEnglish · 2 years agomessage-square33linkfedilink
minus-squaremrspaz@lemmy.worldlinkfedilinkarrow-up26·2 years agoI wrote a program to figure out what day of the week this landed on (assuming it is in fact October 2nd, 151441). It’s a Saturday. Real downer on the start of the weekend.
minus-squareEphera@lemmy.mllinkfedilinkarrow-up6·2 years agoYep, my immediate thought was, how the hell would you know it works?
minus-squareBgugi@lemmy.worldlinkfedilinkarrow-up3·2 years agoBro probably to account for leap Thursday’s. We have one every ~28k years to keep in alignment with the true solar week.
minus-squaredch82@lemmy.ziplinkfedilinkarrow-up1·2 years agoTook me longer than it should have to realise this was a joke.
minus-squareodium@programming.devlinkfedilinkarrow-up3·2 years agoThat program better be using an existing date library, because otherwise it’s most definitely wrong.
minus-squareasyncrosaurus@programming.devlinkfedilinkarrow-up3·2 years agopublic string GetDayOfWeek(DateTime date) => "saturday"; I also calculated it, his result checks out.
minus-squareal4s@lemmy.worldlinkfedilinkarrow-up4·2 years agoDon’t be ridiculous, that would never pass QA. But this one will. Joy for years to come: public string GetDayOfWeek(DateTime date) { return ((date - new DateTime(1970, 1, 1)).Milliseconds / 86400000) % 7 switch { 0 => "Thursday", 1 => "Friday", 2 => "Saturday", 3 => "Sunday", 4 => "Monday" }; }
I wrote a program to figure out what day of the week this landed on (assuming it is in fact October 2nd, 151441).
It’s a Saturday.
Real downer on the start of the weekend.
Yep, my immediate thought was, how the hell would you know it works?
Bro probably to account for leap Thursday’s. We have one every ~28k years to keep in alignment with the true solar week.
Took me longer than it should have to realise this was a joke.
That program better be using an existing date library, because otherwise it’s most definitely wrong.
public string GetDayOfWeek(DateTime date) => "saturday";I also calculated it, his result checks out.
Don’t be ridiculous, that would never pass QA.
But this one will. Joy for years to come: