Skip to main content

Python datetimes made easy.

Project description

Orator Build status

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


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.1.tar.gz (22.2 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page