SourceForge logo
SourceForge logo

pytz

Python historical timezone library and database

This is an exact mirror of the pytz project, hosted at https://github.com/stub42/pytz. SourceForge is not affiliated with pytz. For more information, see the SourceForge Open Source Mirror Directory.
Share This
Email in envelope

Get an email when there's a new version of pytz

Windows Mac Linux BSD ChromeOS

pytz is a Python library that brings the IANA/Olson timezone database into the Python runtime, enabling accurate, cross-platform timezone calculations for all the world’s timezones. It addresses a major limitation of Python’s built-in datetime.tzinfo by providing consistent support for daylight-saving transitions, historical offset changes, and ambiguous times (such as the end of DST). With pytz, developers can convert naïve datetime objects into timezone-aware ones, shift between timezones, and safely perform arithmetic across DST boundaries with methods like localize() and normalize(). Although Python 3.9 and newer include better built-in timezone support (via zoneinfo and external packages like tzdata), pytz remains widely used—especially in legacy codebases or in environments where backward compatibility matters.

Features

  • Full implementation of the IANA/Olson timezone database in Python
  • Methods to localize naïve datetimes and to normalize timezone transitions (especially around DST)
  • Lists of supported timezones (all_timezones, common_timezones) and country-to-timezones mappings
  • Works across a broad range of Python versions, including legacy 2.x and early 3.x versions
  • MIT-licensed, well-tested and mature library designed for production use
  • Clear API for timezone conversion, offset handling, and safe arithmetic in timezone-aware contexts

Project Samples

Project Activity

See All Activity >

Categories

Libraries

License

MIT License

Follow pytz

pytz Web Site

You Might Also Like
Accounting Software Built for Owners, and Their Clients Icon
Accounting Software Built for Owners, and Their Clients

Make invoicing and billing painless for your small business with FreshBooks.

Balancing your books, client relationships, and business isn’t easy. FreshBooks gives you the info and time you need to focus on your big picture—your business, team, and clients.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of pytz!

Additional Project Details

Programming Language

C

Related Categories

C Libraries

Registered

3 days ago
Thanks for helping keep SourceForge clean.
X

Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /