@@ -194,20 +194,22 @@ Time functions in Excel will be a PHP `DateTime` object.
194194
195195#### Excel Timestamps
196196
197- If ` RETURNDATE_EXCEL ` is set for the Return Date Type, then the returned
198- date value by any access to the Date and Time functions in Excel will be
199- a floating point value that represents a number of days from the Excel
200- base date. The Excel base date is determined by which calendar Excel
197+ Excel timestamps are stored as integer or floating point, where the integer portion represents the number of days since a base date,
198+ and the fraction portion represents the time of day (0 is midnight, 0.5 is noon, 0.999... is just before midnight the next day).
199+ The Excel base date is determined by which calendar Excel
201200uses: the Windows 1900 or the Mac 1904 calendar. 1st January 1900 is the
202201base date for the Windows 1900 calendar while 1st January 1904 is the
203202base date for the Mac 1904 calendar.
204203
205- It is possible for scripts to change the calendar used for calculating
206- Excel date values by calling the
207- ` \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar() ` method:
204+ If ` RETURNDATE_EXCEL ` is set for the Return Date Type, then the returned
205+ date value by any access to the Date and Time functions in Excel will be
206+ a floating point value in Excel timestamp format (previous paragraph).
208207
208+ It is possible for scripts to change the calendar used for calculating
209+ Excel date values by calling:
209210``` php
210- \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar($baseDate);
211+ \PhpOffice\PhpSpreadsheet\Shared\Date::setExcelCalendar($baseDate); // static property, less preferred
212+ $spreadsheet->setExcelCalendar($baseDate); // instance property, preferred
211213```
212214
213215where the following constants can be used for ` $baseDate ` :
@@ -218,11 +220,10 @@ where the following constants can be used for `$baseDate`:
218220The method will return a Boolean True on success, False on failure (e.g.
219221if an invalid value is passed in).
220222
221- The ` \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar() ` method can
222- be used to determine the current value of this setting:
223-
223+ The current value of this setting can be determined via:
224224``` php
225- $baseDate = \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar();
225+ $baseDate = \PhpOffice\PhpSpreadsheet\Shared\Date::getExcelCalendar(); // static
226+ $baseDate = $spreadsheet->getExcelCalendar(); // instance
226227```
227228
228229The default is ` CALENDAR_WINDOWS_1900 ` .
0 commit comments