initDefaultTimezone.php
Table of Contents
Functions
- initDefaultTimezone() : void
- Initialize the application's default timezone.
Functions
initDefaultTimezone()
Initialize the application's default timezone.
initDefaultTimezone(string|null $timezoneId[, string $defaultTimezone = 'Europe/Paris' ]) : void
This function sets the global timezone used by all date/time functions. If $timezoneId is null, $defaultTimezone will be applied.
Notes:
- If an invalid identifier is provided, PHP will return false and emit a warning.
- Prefer passing null rather than an empty string to trigger the default timezone.
Parameters
- $timezoneId : string|null
-
Timezone identifier to apply. Use null to apply $defaultTimezone.
- $defaultTimezone : string = 'Europe/Paris'
-
Timezone to use when $timezoneId is null (default 'Europe/Paris').