{"id":15764555,"url":"https://github.com/pavkam/tzdb","last_synced_at":"2026-02-02T14:33:23.921Z","repository":{"id":16134775,"uuid":"18880097","full_name":"pavkam/tzdb","owner":"pavkam","description":"Delphi/FPC Time Zone Database","archived":false,"fork":false,"pushed_at":"2025-05-01T09:03:51.000Z","size":9431,"stargazers_count":87,"open_issues_count":0,"forks_count":29,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-06-20T23:04:29.557Z","etag":null,"topics":["delphi","fpc","iana","pascal","time-zone-table","time-zones","tzdb"],"latest_commit_sha":null,"homepage":"https://www.iana.org/time-zones","language":"Pascal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pavkam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-04-17T13:56:03.000Z","updated_at":"2025-06-18T09:53:58.000Z","dependencies_parsed_at":"2024-01-01T10:23:55.013Z","dependency_job_id":"b07a82cc-b308-4f09-a409-a8f3ed57a8bf","html_url":"https://github.com/pavkam/tzdb","commit_stats":{"total_commits":237,"total_committers":11,"mean_commits":"21.545454545454547","dds":0.2911392405063291,"last_synced_commit":"4fdc1a6b66fe1112b9cc920fde532f4409d33251"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"purl":"pkg:github/pavkam/tzdb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavkam%2Ftzdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavkam%2Ftzdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavkam%2Ftzdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavkam%2Ftzdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pavkam","download_url":"https://codeload.github.com/pavkam/tzdb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pavkam%2Ftzdb/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29013034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-02T12:48:30.580Z","status":"ssl_error","status_checked_at":"2026-02-02T12:46:38.384Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delphi","fpc","iana","pascal","time-zone-table","time-zones","tzdb"],"created_at":"2024-10-04T12:04:05.634Z","updated_at":"2026-02-02T14:33:23.907Z","avatar_url":"https://github.com/pavkam.png","language":"Pascal","funding_links":[],"categories":["Other non-visual"],"sub_categories":[],"readme":"# TZDB - IANA Time Zone Database for Delphi/FreePascal\n\n[![GNU/Linux](https://github.com/pavkam/tzdb/actions/workflows/test-linux.yml/badge.svg)](https://github.com/pavkam/tzdb/actions/workflows/test-linux.yml)\n[![macOS](https://github.com/pavkam/tzdb/actions/workflows/test-macos.yml/badge.svg)](https://github.com/pavkam/tzdb/actions/workflows/test-macos.yml)\n[![Windows (FPC)](https://github.com/pavkam/tzdb/actions/workflows/test-windows-fpc.yml/badge.svg)](https://github.com/pavkam/tzdb/actions/workflows/test-windows-fpc.yml)\n[![TZDB/CLDR Bump](https://github.com/pavkam/tzdb/actions/workflows/bump.yml/badge.svg?branch=master)](https://github.com/pavkam/tzdb/actions/workflows/bump.yml)\n\n## Table of Contents\n\n- [Introduction](#introduction)\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n- [Common Examples](#common-examples)\n- [Important Considerations](#important-considerations)\n- [Updating TZDB](#updating-tzdb)\n- [Tools](#tools)\n- [License](#license)\n\n## Introduction\n\n**TZDB** is an offline, in-process compiled database for [IANA's TZDB project](https://www.iana.org/time-zones). It provides reliable time zone conversion and calculation capabilities without requiring external services or runtime dependencies.\n\nThe current version is compiled with **2025b** version of IANA TZDB and the latest Windows alias translation table (from CLDR project).\n\nThe source code is compatible with **Delphi XE+** and **FreePascal 3+**, though some components are only available for Delphi.\n\n📚 [API Documentation](https://github.com/pavkam/tzdb/wiki/API-Documentation) | 💻 [Code Examples](https://github.com/pavkam/tzdb/wiki/Code-Examples)\n\n## Features\n\n- **Offline operation**: No network dependencies or external services required\n- **Small footprint**: Single-file implementation with pre-compiled TZDB database\n- **Windows alias support**: Easily convert between Windows time zone names and IANA identifiers\n- **Comprehensive API**: Rich set of methods for time zone conversions and calculations\n- **Pure Pascal implementation**: No external dependencies or DLLs\n\n## Installation\n\n### Option 1: Direct inclusion (simplest)\n\nDownload [TZDB.pas](https://raw.githubusercontent.com/pavkam/tzdb/master/dist/TZDB.pas) and add it to your project.\n\n### Option 2: Git submodule\n\n```bash\ngit submodule add https://github.com/pavkam/tzdb.git\n```\n\n## Usage\n\nSimply include the TZDB unit in your `uses` clause:\n\n```pascal\nuses TZDB;\n```\n\n## Common Examples\n\n### Get a time zone and convert local time to UTC\n\n```pascal\nuses TZDB;\n\nvar\n  LTimeZone: TBundledTimeZone;\nbegin\n  // Get time zone by IANA identifier\n  LTimeZone := TBundledTimeZone.GetTimeZone('Africa/Cairo');\n\n  // Convert local time to UTC\n  WriteLn(LTimeZone.ToUniversalTime(Now));\nend;\n```\n\n### Using Windows time zone names\n\n```pascal\nuses TZDB;\n\nvar\n  LTimeZone: TBundledTimeZone;\nbegin\n  // Get time zone by Windows identifier\n  LTimeZone := TBundledTimeZone.GetTimeZone('Eastern Standard Time');\n\n  // Display information\n  WriteLn('IANA ID: ', LTimeZone.ID);\n  WriteLn('Current offset: ', LTimeZone.UtcOffset);\nend;\n```\n\n### Check for ambiguous or invalid times\n\n```pascal\nuses TZDB;\n\nvar\n  LTimeZone: TBundledTimeZone;\n  LLocalTime: TDateTime;\n  LTimeType: TLocalTimeType;\nbegin\n  LTimeZone := TBundledTimeZone.GetTimeZone('America/New_York');\n  LLocalTime := EncodeDate(2023, 11, 5) + EncodeTime(1, 30, 0, 0); // Fall DST transition\n\n  // Check what type of local time this is\n  LTimeType := LTimeZone.GetLocalTimeType(LLocalTime);\n\n  case LTimeType of\n    lttInvalid: WriteLn('This time does not exist (skipped during DST start)');\n    lttAmbiguous: WriteLn('This time is ambiguous (occurs twice during DST end)');\n    lttStandard: WriteLn('This is a standard time');\n    lttDaylight: WriteLn('This is a daylight saving time');\n  end;\nend;\n```\n\n## Important Considerations\n\n| Issue | Description | Handling |\n|-------|-------------|----------|\n| **Invalid IDs** | Unknown time zone IDs cause exceptions | `TBundledTimeZone.Create` throws `ETimeZoneInvalid` |\n| **Year range** | The database covers a limited year range | Methods may throw `EUnknownTimeZoneYear` for dates outside coverage |\n| **Ambiguous times** | During DST→Standard transitions, some hours occur twice | Use `AForceDaylight` parameter to control interpretation |\n| **Invalid times** | During Standard→DST transitions, some hours are skipped | Handle `ELocalTimeInvalid` exceptions or check with `GetLocalTimeType` |\n| **Daylight support** | Not all time zones have daylight saving time | Use `HasDaylightTime` to check before DST operations |\n| **Multiple periods** | Some zones have multiple DST periods in a year | Don't assume a single daylight/standard transition per year |\n| **Dynamic properties** | Display names and offsets change throughout the year | Don't rely on `DisplayName`, `Abbreviation`, or `UtcOffset` as constants |\n\n## Updating TZDB\n\n### Automatic Updates\n\nThis project follows IANA releases closely, typically with a 1-2 week delay.\n\n### Manual Updates\n\nTo update manually:\n\n1. Use the [update-compile.sh](https://raw.githubusercontent.com/pavkam/tzdb/master/update-compile.sh) script\n2. Run under MacOS, Linux, or Windows WSL\n3. Requires Free Pascal compiler\n\n## Tools\n\n### Time Zone Visualizer\n\nA development tool to display time zone details (Windows only):\n\n![Screen shot](media/tz_vis.jpg)\n\n## License\n\nThis project is available under [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavkam%2Ftzdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpavkam%2Ftzdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpavkam%2Ftzdb/lists"}