Pendulum is a Python package to ease datetime's manipulation. It provides classes that are drop-in replacements for the native ones (they inherit from them). Special care has been taken to ensure timezones are handled correctly, and are based on the underlying tzinfo implementation. For example, all comparisons are done in UTC or in the timezone of the datetime being used. There are several different methods available to create a new DateTime instance. datetime() sets the time to 00:00:00 if it's not specified, and the timezone (the tz keyword argument) to UTC. Otherwise it can be a Timezone instance or simply a string timezone value. Pendulum gives access to more attributes and properties than the default datetime class. The __str__ magic method is defined to allow DateTime instances to be printed as a pretty date string when used in a string context. Simple comparison is offered up via the basic operators.

Features

  • Pendulum improves the standard timedelta class by providing more intuitive methods and properties
  • Removes the notion of naive datetimes
  • Each Pendulum instance is timezone-aware and by default in UTC for ease of use
  • Pendulum is a drop-in replacement for the standard datetime class
  • You can replace all your datetime instances by DateTime instances in you code
  • Supports Python 2.7 and 3.4+

Project Samples

Project Activity

See All Activity >

Categories

Scheduling, Calendar

License

MIT License

Follow Pendulum

Pendulum Web Site

Other Useful Business Software
MongoDB Atlas runs apps anywhere Icon
MongoDB Atlas runs apps anywhere

Deploy in 115+ regions with the modern database for every enterprise.

MongoDB Atlas gives you the freedom to build and run modern applications anywhere—across AWS, Azure, and Google Cloud. With global availability in over 115 regions, Atlas lets you deploy close to your users, meet compliance needs, and scale with confidence across any geography.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Pendulum!

Additional Project Details

Programming Language

Python

Related Categories

Python Scheduling Software, Python Calendar Software

Registered

2021-12-14