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.tar.gz (21.9 kB view details)

Uploaded Source

File details

Details for the file pendulum-0.1.tar.gz.

File metadata

  • Download URL: pendulum-0.1.tar.gz
  • Upload date:
  • Size: 21.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pendulum-0.1.tar.gz
Algorithm Hash digest
SHA256 7c2d47136f0557453b45ef9dcf43f9af3d333f5aef585a1f2553d2a0ed6b0d93
MD5 a5b8dac262efb51a27b0815486d2829a
BLAKE2b-256 75c4f9bb02e08f934f5e8b3ac7ddfe51970efbb7044b9aa8483aa261d83464bd

See more details on using hashes here.

Supported by

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