adds logic for handling dates and times