Python datetimes made easy.
Project description
Python datetimes made easy.
import pendulum
now_in_paris = pendulum.now('Europe/Paris')
'2016-07-04T00:49:58.502116+02:00'
now_in_paris.to('UTC')
'2016-07-03T22:49:58.502116+00:00'
tomorrow = pendulum.now().add_day()
last_week = pendulum.now().sub_week()
if pendulum.now().is_weekend():
print('Party!')
past = pendulum.now().sub_minutes(2)
past.diff_for_humans()
'2 minutes ago'
delta = past - last_week
delta.hours
23
delta.for_humans(locale='fr')
'6 jours 23 heures 58 minutes'
Resources
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pendulum-0.1.tar.gz
(21.9 kB
view hashes)