You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using ex02-formats.php the last 2 Dates columns were not presented as expexted in Excel 365 for Mac (16.71)
The value in those cells is : -693625,00001157
Opening the file in LibreOffice show expected presentation
Took me a while to find the cause. Excel can't cope with years < 1900 or > 9999
Therefore the class has a boundary check at lines 877-883 in function function convert_date_time
But if only a time as in custom-time1 and custom-time2 is given as $date_input, $day and $month and $year are 0, so $days is calculated as -693626
The easiest solution/workaround I could find, was to add this line after $seconds was calculated:
if ($day ==0) return $seconds;
The text was updated successfully, but these errors were encountered:
Using ex02-formats.php the last 2 Dates columns were not presented as expexted in Excel 365 for Mac (16.71)
The value in those cells is : -693625,00001157
Opening the file in LibreOffice show expected presentation
Took me a while to find the cause. Excel can't cope with years < 1900 or > 9999
Therefore the class has a boundary check at lines 877-883 in function function convert_date_time
But if only a time as in custom-time1 and custom-time2 is given as $date_input, $day and $month and $year are 0, so $days is calculated as -693626
The easiest solution/workaround I could find, was to add this line after $seconds was calculated:
if ($day ==0) return $seconds;
The text was updated successfully, but these errors were encountered: