H. Hinnant's date class (slightly modified)