RepositoryPythonESSpain
nayarsystems

nayarsystems/posix_tz_db

Generates POSIX timezones strings

200stars
89forks
6issues
3views

POSIX Timezone Database Generator

A simple Python tool that generates POSIX timezone strings from system timezone data.

Overview

This tool reads binary timezone files from /usr/share/zoneinfo/ and extracts POSIX timezone strings, outputting them in either CSV or JSON format. It covers 469 timezone identifiers including all major regions worldwide.

Usage

# Generate CSV output
python gen-tz.py --csv

# Generate JSON output
python gen-tz.py --json

# Save to files
python gen-tz.py --csv > zones.csv
python gen-tz.py --json > zones.json

Output Format

CSV Format

"America/New_York","EST5EDT,M3.2.0,M11.1.0"
"Europe/London","GMT0BST,M3.5.0/1,M10.5.0"
"Asia/Tokyo","JST-9"

JSON Format

{
  "America/New_York": "EST5EDT,M3.2.0,M11.1.0",
  "Europe/London": "GMT0BST,M3.5.0/1,M10.5.0",
  "Asia/Tokyo": "JST-9"
}

POSIX Timezone String Format

The POSIX strings encode timezone rules including:

  • Standard time abbreviation and UTC offset
  • Daylight saving time rules (if applicable)
  • DST transition dates using the format M<month>.<week>.<day>

Examples:

  • GMT0 - Greenwich Mean Time, no DST
  • EST5EDT,M3.2.0,M11.1.0 - Eastern Time with DST transitions
  • JST-9 - Japan Standard Time, UTC+9, no DST

Requirements

  • Python 3 (standard library only)
  • System timezone data (/usr/share/zoneinfo/)
  • No external dependencies

License

MIT License - See LICENSE file for details

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
myusuf3/delorean

Delorean: Time Travel Made Easy

1.8k
Oct 28, 2026
RepositoryGo
dromara/carbon

A simple, semantic and developer-friendly time package for golang

5.2k
Dec 1, 2026
RepositoryC++
HowardHinnant/date

A date and time library based on the C++11/14/17 <chrono> header

3.4k
Nov 24, 2026
RepositorySwift
davedelong/time

Robust and type-safe date and time calculations for Swift

2.3k
Sep 5, 2026
RepositoryJavaScript
js-joda/js-joda

:clock2: Immutable date and time library for javascript

1.7k
Nov 26, 2026
RepositoryJavaScript
marnusw/date-fns-tz

Complementary library for date-fns v2 adding IANA time zone support

1.2k
Dec 31, 2024
RepositoryTypeScript
vvo/tzdb

Always up to date IANA time zones for time zone pickers: grouped list with major cities, current offsets, DST abbreviations, and the country of any time zone. Updated daily.

917
Nov 26, 2026
RepositoryGo
k8tz/k8tz

Kubernetes admission controller and a CLI tool to inject timezones into Pods and CronJobs

530
Oct 31, 2026
RepositoryElixir
mathieuprog/tz

Time zone support for Elixir

167
Oct 17, 2026