### GetWeekday

Posted:

**15 Apr 2014, 08:58****GetWeekday**

Get the weekday on any given date

e.g. "1990-01-01" --> "Monday"

Source: GitHub

Code: Select all

```
GetWeekday(month, day, year)
{
static WeekDay := ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
d := day, m := month, y := year
if (m < 3)
{
m += 12
y -= 1
}
wd := mod(d + (2 * m) + floor(6 * (m + 1) / 10) + y + floor(y / 4) - floor(y / 100) + floor(y / 400) + 1, 7) + 1
return WeekDay[wd]
}
MsgBox, % GetWeekday(1, 1, 1990) ; 1990-01-01 --> Monday
```