refactor datetime to one type