Implementing Weekday system function.