/** * Parse and return carbon object or formatted time string * @return Carbon\Carbon */ protected function parseDateAsCarbon() { // Convert excel time to php date object $date = PHPExcel_Shared_Date::ExcelToPHPObject($this->cell->getCalculatedValue())->format('Y-m-d H:i:s'); // Parse with carbon $date = Carbon::parse($date); // Format the date if wanted return $this->reader->getDateFormat() ? $date->format($this->reader->getDateFormat()) : $date; }