move date time formatting to controller