QB64 Phoenix Edition
What day is Christmas on - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Christmas Code (https://qb64phoenix.com/forum/forumdisplay.php?fid=48)
+---- Thread: What day is Christmas on (/showthread.php?tid=3236)



What day is Christmas on - eoredson - 11-30-2024

Code to determine what day Christmas of 2024 is on:

Code: (Select All)
Rem determine day of week Christmas of 2024 is:
m% = 12 ' month
d% = 26 ' day
y% = 2024 ' year
If m% < 3 Then m% = m% + 12: y% = y% - 1
W% = ((13 * m% + 3) \ 5 + d% + y% + y% \ 4 - y% \ 100 + y% \ 400 + 1) Mod 7
Select Case W%
  Case 0
      WeekDayLong$ = "Sunday"
  Case 1
      WeekDayLong$ = "Monday"
  Case 2
      WeekDayLong$ = "Tuesday"
  Case 3
      WeekDayLong$ = "Wednesday"
  Case 4
      WeekDayLong$ = "Thursday"
  Case 5
      WeekDayLong$ = "Friday"
  Case 6
      WeekDayLong$ = "Saturday"
End Select
Print "Christmas of 2024 is on: "; WeekDayLong$
End