Skip to content

Negative time values #4265

Answered by oleibman
mcurtaz asked this question in Q&A
Discussion options

You must be logged in to vote

This appears to have been an oversight from when we added the ability to set the calendar by spreadsheet rather than globally. You should still be able to get the result you want as follows:

        if (method_exists($spreadsheet, 'setExcelCalendar')) {
            $spreadsheet->setExcelCalendar(Date::CALENDAR_MAC_1904);
        } else {
            Date::setExcelCalendar(Date::CALENDAR_MAC_1904);
        }

What a horrible kludge for MS to have inflicted on its users.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mcurtaz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants