I have a script that generates a calendar. It's worked fine for two or three years now, but at the beginning of this month, the days were incorrect. It displays February 1, 2008 as being a Wednesday, when it was a Friday.
Here's the code:
-
dim startday
-
startday = weekday(month & "/" & day & "/" & year)
-
select case startday
-
case 1
-
'Sunday
-
case 2
-
'Monday
-
'etc.
-
Instead of evaluating to 6, or Friday, weekday("2/1/2008") evaluates to 4, or Wednesday. However, weekday("1/31/2008") evaluates to 5, or Thursday. I checked the values for month, day, and year, and they are 2, 1, and 2008 respectively when the code fires.
I even tried weekday("2/1/2008") on w3schools in the Try It editor, and it evaluated to 3 as well.
Any ideas?