the weekday () function returns the weekday of given date if the method is 1 (default) weekday () returns 1 for sunday 2 for monday if the method is 2 monday is 1 tuesday 2 and if the method is 3 weekday () returns 0 for monday 1 for tuesday