Error thrown

Object of class DateTimeImmutable could not be converted to string