Parses the IANA timezone database (Olson format) and generates iCalendar VTIMEZONE components.
composer require horde/timezoneuse Horde\Timezone\TimezoneDatabase;
use Horde\Timezone\TimezoneDatabaseConfig;
$db = new TimezoneDatabase(new TimezoneDatabaseConfig(
location: '/path/to/tzdata/',
));
echo $db->getZone('America/New_York')->toVtimezone();The location parameter accepts:
- A directory path containing unpacked Olson source files
- A path to a
.tar.gztarball - A URL to download (default:
ftp://ftp.iana.org/tz/tzdata-latest.tar.gz)
The PSR-0 Horde_Timezone class in lib/ remains available for backward
compatibility. See doc/UPGRADING.md
for migration guidance to the modern Horde\Timezone namespace.
LGPL-2.1-only. See LICENSE for details.