Added functions to return the weekday from a date.
Fixed benign bug that allowed duplicate format options through.
Reversed the command string; put the functions at the back after the calculation has been done.  Less confusing.