-
hi all
does anyone know a formula to find out what day of the week it is given a date, a month and a year (years ago I was given it at Uni). This is purely mathematical formula it takes into an account leap years as well and it can give you what day it was on 01/01/0001 for example
Thanks
Ilia
-
I know the formula you mean and I can't remember it either, but you could use DateDiff to return the number of days difference and use Mod 7 to work out the relative difference from today.
Cheers,
P.
-
Can this meet your needs?
Code:
------------------------------
Text1.Text = Weekday(#1/20/1960#)
------------------------------
-
-
If you need the name of the day of the week, use:
Code:
Text1.Text = WeekdayName(Weekday(#1/20/1960#))
In VB, the week starts on a Sunday, but you can change that in the parameters for both Weekday and WeekdayName.
-
Code:
MsgBox Format(Date, "dddd")