diff --git a/docs/topics/calculation-engine.md b/docs/topics/calculation-engine.md index 1854ac06..f1d1c2c1 100644 --- a/docs/topics/calculation-engine.md +++ b/docs/topics/calculation-engine.md @@ -263,6 +263,28 @@ return an Excel date timestamp. Takes year, month and day values (and optional hour, minute and second values) and returns an Excel date timestamp value. +### Timezone support for Excel date timestamp conversions + +The default timezone for the date functions in PhpSpreadsheet is UST (Universal Standard Time). +If a different timezone needs to be used, these methods are available: + +#### \PhpOffice\PhpSpreadsheet\Shared\Date::getDefaultTimezone() + +Returns the current timezone value PhpSpeadsheet is using to handle dates and times. + +#### \PhpOffice\PhpSpreadsheet\Shared\Date::setDefaultTimezone($timeZone) + +Sets the timezone for Excel date timestamp conversions to $timeZone, +which must be a valid PHP DateTimeZone value. +The return value is a Boolean, where true is success, +and false is failure (e.g. an invalid DateTimeZone value was passed.) + +#### \PhpOffice\PhpSpreadsheet\Shared\Date::excelToDateTimeObject($excelDate, $timeZone) +#### \PhpOffice\PhpSpreadsheet\Shared\Date::excelToTimeStamp($excelDate, $timeZone) + +These functions support a timezone as an optional second parameter. +This applies a specific timezone to that function call without affecting the default PhpSpreadsheet Timezone. + ## Function Reference ### Database Functions