Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem with "MOD"
#4
For the  Gregorian Calendar I code it like this...

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 ****! Big Grin

Pete
Reply


Messages In This Thread
Problem with "MOD" - by Kernelpanic - 01-05-2025, 09:30 PM
RE: Problem with "MOD" - by SMcNeill - 01-05-2025, 09:57 PM
RE: Problem with "MOD" - by Kernelpanic - 01-05-2025, 10:39 PM
RE: Problem with "MOD" - by Pete - 01-06-2025, 02:01 AM
RE: Problem with "MOD" - by SMcNeill - 01-06-2025, 02:22 AM
RE: Problem with "MOD" - by Pete - 01-06-2025, 02:37 AM



Users browsing this thread: 1 Guest(s)