You're viewing a single thread.
View all comments
33
comments
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.
26 0 Reply26 0 ReplyYep, my immediate thought was, how the hell would you know it works?
6 0 ReplyBro probably to account for leap Thursday's. We have one every ~28k years to keep in alignment with the true solar week.
3 0 ReplyTook me longer than it should have to realise this was a joke.
1 0 Reply
That program better be using an existing date library, because otherwise it's most definitely wrong.
3 0 Replypublic string GetDayOfWeek(DateTime date) => "saturday";
I also calculated it, his result checks out.
3 0 ReplyDon'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" }; }
4 0 Reply
You've viewed 33 comments.
Scroll to top