This version brings small additions and drops official support for Python 3.2 and 3.3.

New Features

New timezones attribute

A timezones attribute has been added which exposes available timezones.

>>> import pendulum
>>> pendulum.timezones
('CET',
 'CST6CDT',
 'Cuba',
 'EET',
 'Egypt',
 'Eire',
 ...,
 'US/Michigan',
 'US/Mountain',
 'US/Pacific',
 'US/Pacific-New',
 'US/Samoa')

Alternative tokens are now supported in from_format()

Alternative tokens can now be used in from_format() by passing formatter='alternative'

>>> import pendulum
>>> pendulum.from_format('1975-05-21 22', 'YYYY-MM-DD HH', formatter='alternative')
<Pendulum [1975-05-21T22:00:00+00:00]>

New exact keyword in parse()

A new exact keyword has been added to parse() which behaves exactly like strict which will have another meaning in the next major version.

Changes

  • Python 3.2 and 3.3 support has been dropped.
  • The classic formatter in from_format() is now deprecated and will be removed in the next major version.

Fixes

  • Fixed th locale. (Thanks to idxn)
View Comments