The pendulum is one of the popular Python DateTime libraries to ease DateTime manipulation. It simplifies the problem of complex date manipulations involving timezones which are not handled correctly in native DateTime instances.
It is inherited from the standard DateTime library but has a speciality to provide better functionality. So we can introduce Pendulums Datetime instances in projects which are already using the built-in DateTime class .
Now ,the question is how to install it ??
It is very simple to install just open the terminal and write the below command and then run it.
pip install pendulum
Now, our first task is done to install pendulum library.
Before we run ahead we should know some basic functions of pendulum.These function helps to create DateTime instance these are datetime(), local(),now().
1. 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. Supported strings for timezones are the ones provided by the IANA time zone database.
2.Local(): It is similar to DateTime() but automatically sets the timezone to the local timezone
now() method is used to display the current date-time of a particular zone.