convert to dates and fix duration calculation