01-06-2025, 02:01 AM
For the Gregorian Calendar I code it like this...
For the Julian Calendar... I don't give a ****!
Pete
Code: (Select All)
mo = Val(Mid$(Date$, 1, 2))
yr = Val(Mid$(Date$, 7, 4))
dy = Val(Mid$(Date$, 4, 2))
Select Case mo
Case 1: month$ = "Jan": ordinal = 0
Case 2: month$ = "Feb": ordinal = 31
Case 3: month$ = "Mar": ordinal = 59
Case 4: month$ = "Apr": ordinal = 90
Case 5: month$ = "May": ordinal = 120
Case 6: month$ = "Jun": ordinal = 151
Case 7: month$ = "Jul": ordinal = 181
Case 8: month$ = "Aug": ordinal = 212
Case 9: month$ = "Sep": ordinal = 243
Case 10: month$ = "Oct": ordinal = 273
Case 11: month$ = "Nov": ordinal = 304
Case 12: month$ = "Dec": ordinal = 334
End Select
xdays = (365 * yr) + yr \ 4 - yr \ 100 + yr \ 400 - 365
If yr Mod 4 = 0 And yr Mod 100 Or yr Mod 4 = 0 And yr Mod 100 = 0 And yr Mod 400 = 0 Then leapyear = 1
xdays = xdays + ordinal + 1
If leapyear And mo < 3 Then xdays = xdays - 1
xover = xdays Mod 7 ' The day of the week the first day of month and year appears on the calendar. 0 to 6 for Sunday to Saturday.
For the Julian Calendar... I don't give a ****!
Pete