It's a DateTime object, so just use it ?
https://www.php.net/manual/en/class.datetime.php
hint : use format method
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
print date 2019-04-01 00:00:00 how to remove time format in date format
current i use
'Bill_Date' => \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row['1'])
@VANDAN - Well that's a shame ... all you had to do is click on the link, find the format method, click on it and you would have had all the examples.
'Bill_Date' => \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($row['1'])->format('Y-m-d')
Please or to participate in this conversation.