fixing up date stuff
refactoring date conversions