Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

vandan's avatar
Level 13

Excel Import Date Format issue .

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'])

0 likes
5 replies
vandan's avatar
Level 13

@STEREOH - i cant properly understand can you just example of how to return only date not show time format

STEREOH's avatar
STEREOH
Best Answer
Level 18

@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')
1 like
Jaikangam's avatar

thanks it work for me on the assign answer as best.

Please or to participate in this conversation.