By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
This is a class that will return the day of the week for both the Gregorian and Julian calendars.
Example code: Dim DT As DayOfWeek Dim DOW As String Set DT = New DayOfWeek(Now) DOW = DT.Gregorian
Class DayOfWeek Weekday As String Weekday As String Sub New (DT As Variant) Dim a, y, m As Integer a = 14 - Month(DT) y = Year(DT) - a m = Month(DT) + (12 * a) - 2 Me.Weekday = (5 + Day(DT) + y + (y / 4) + ((31 * m) / 12)) Mod 7 Me.Weekday = (Day(DT) + y + (y/4) - (y/100) + (y/400) + ((31*m)/12)) Mod 7 End Sub End Class