fixed date format so that it is correctly ordered by SQL