horde/timezone

Timezone library

Maintainers

Package info

github.com/horde/Timezone

Homepage

pkg:composer/horde/timezone

Statistics

Installs: 951

Dependents: 1

Suggesters: 0

Stars: 1

Open Issues: 0

v2.0.0RC1 2026-05-25 00:00 UTC

README

Parses the IANA timezone database (Olson format) and generates iCalendar VTIMEZONE components.

Installation

composer require horde/timezone

Quick start

use 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.gz tarball
  • A URL to download (default: ftp://ftp.iana.org/tz/tzdata-latest.tar.gz)

Legacy API

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.

License

LGPL-2.1-only. See LICENSE for details.