Date format was causing errors - this now outputs the correct date format