Change datetime to date in database and format properly in view