Just the fact that you asked the question indicates that you expected a different result..
What result did you expect that function to return, and why?
Note, I'm not saying anything bad here, just trying to help.
Perhaps the weekday function is not the correct function for what you're trying to do.