Better design for date-time calculations