How to Read Date Format in PHP EXCEL ?

555

How to Read Date Format in PHP EXCEL :

when some time excel date convert like :

2023/02/18 => 44975


$xls_date = 44975; 
$unix_date = ($xls_date - 25569) * 86400;

print_r($unix_date );

OUTPUT:

1676678400

</pre>
$xls_date = 44975;

$unix_date = ($xls_date - 25569) * 86400;

$xls_date = 25569 + ($unix_date / 86400);
$unix_date = ($xls_date - 25569) * 86400;
echo date("Y-m-d", $unix_date);

OUTPUT:

2023-02-18

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here