public function createExcelDate(\DateTime $date)
    {
        $day = clone $date;
        $endDate = $day->setTime(0, 0, 0);
        $startDate = new \DateTime('1970-01-01 00:00:00');
        $diff = $endDate->diff($startDate)->format('%a');

        if ($endDate < $startDate) {
            $daysBetween = 25569 - $diff;
        } else {
            $daysBetween = 25569 + $diff;
        }

        $seconds = $date->getTimestamp() - $endDate->getTimestamp();

        return (float)$daysBetween + ($seconds / 86400);
    }