Search by

lakeshoretim / ziptotimezone-php

LakeshoreTim

Convert Zip Codes to Time Zones

Package info

github.com/LakeshoreTim/ZipToTimezone-php

pkg:composer/lakeshoretim/ziptotimezone-php

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

v1.1.0 2026-09-13 19:08 UTC

This package is auto-updated.

Last update: 2026-09-13 19:24:08 UTC


README

PHP Version License

PHP SDK for [ZipToTimezone] - convert zip codes to time zones.

Requirements

  • PHP 7.0 or higher
  • Composer

Installation

composer require lakeshoretim/ziptotimezone-php

Example

use LakeshoreTim\ZipToTimezonePhp\ZipAndTimeZones;

// Get the TimeZone "name" from a given zip code
$input  = "60606";
$output = ZipAndTimeZones::calcTimezoneName ($input)
echo "The time zone for " .$input. " is " .$output;

// Get the time zone offset from UTC from a given zip code (Standard Time)
$input  = "90210";
$output = ZipAndTimeZones::getStandardTimeOffset ($input)
echo "The Standard Time offset for " .$input. " is " .$output;

// Get the time zone offset from UTC from a given zip code (Daylight Savings Time)
$input  = "86023";
$output = ZipAndTimeZones::getDSTOffset ($input)
echo "The Daylight Savings Time offset for " .$input. " is " .$output;

Staying in Sync with IANA Time Zone Data

Time zone rules aren't static — Daylight Saving Time observance and UTC offsets occasionally change at the government level. This library's data is checked against IANA's tzdata (the canonical time zone database used by most operating systems and programming languages) via an automated process that watches for new releases mentioning any of the 25 zones this library covers, so that a real-world rule change doesn't go unnoticed.

License

MIT License - see LICENSE file.

Links