HTTP/2 301
via: 1.1 varnish, 1.1 varnish, 1.1 varnish
content-type: text/html
location: https://pypi.python.org/pypi/parsedatetime/?
accept-ranges: bytes
age: 0
date: Sun, 12 Oct 2025 13:36:32 GMT
x-served-by: cache-iad-kjyo7100118-IAD, cache-iad-kjyo7100179-IAD, cache-bom-vanm7210030-BOM
x-cache: MISS, MISS, MISS
x-cache-hits: 0, 0, 0
x-timer: S1760276192.183178,VS0,VE224
strict-transport-security: max-age=63072000; includeSubDomains; preload
content-length: 162
HTTP/2 301
server: Varnish
retry-after: 0
location: https://pypi.org/pypi/parsedatetime/
content-type: text/html; charset=UTF-8
accept-ranges: bytes
date: Sun, 12 Oct 2025 13:36:32 GMT
x-served-by: cache-bom-vanm7210069-BOM
x-cache: HIT
x-cache-hits: 0
x-timer: S1760276192.461691,VS0,VE0
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-frame-options: deny
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
permissions-policy: publickey-credentials-create=(self),publickey-credentials-get=(self),accelerometer=(),ambient-light-sensor=(),autoplay=(),battery=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),execution-while-not-rendered=(),execution-while-out-of-viewport=(),fullscreen=(),gamepad=(),geolocation=(),gyroscope=(),hid=(),identity-credentials-get=(),idle-detection=(),local-fonts=(),magnetometer=(),microphone=(),midi=(),otp-credentials=(),payment=(),picture-in-picture=(),screen-wake-lock=(),serial=(),speaker-selection=(),storage-access=(),usb=(),web-share=(),xr-spatial-tracking=()
content-length: 122
HTTP/2 301
location: https://pypi.org/project/parsedatetime/
referrer-policy: origin-when-cross-origin
content-security-policy: base-uri 'self'; connect-src 'self' https://api.github.com/repos/ https://api.github.com/search/issues https://gitlab.com/api/ https://analytics.python.org fastly-insights.com *.fastly-insights.com *.ethicalads.io https://api.pwnedpasswords.com https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/sre/mathmaps/ https://2p66nmmycsj3.statuspage.io; default-src 'none'; font-src 'self' fonts.gstatic.com; form-action 'self' https://checkout.stripe.com https://billing.stripe.com; frame-ancestors 'none'; frame-src 'none'; img-src 'self' https://pypi-camo.freetls.fastly.net/ *.fastly-insights.com *.ethicalads.io ethicalads.blob.core.windows.net; script-src 'self' https://analytics.python.org *.fastly-insights.com *.ethicalads.io 'sha256-U3hKDidudIaxBDEzwGJApJgPEf2mWk6cfMWghrAa6i0=' https://cdn.jsdelivr.net/npm/mathjax@3.2.2/ 'sha256-1CldwzdEg2k1wTmf7s5RWVd7NMXI/7nxxjJM2C4DqII=' 'sha256-0POaN8stWYQxhzjKS+/eOfbbJ/u4YHO5ZagJvLpMypo='; style-src 'self' fonts.googleapis.com *.ethicalads.io 'sha256-2YHqZokjiizkHi1Zt+6ar0XJ0OeEy/egBnlm+MDMtrM=' 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=' 'sha256-JLEjeN9e5dGsz5475WyRaoA4eQOdNPxDIeUhclnJDCE=' 'sha256-mQyxHEuwZJqpxCw3SLmc4YOySNKXunyu2Oiz1r3/wAE=' 'sha256-OCf+kv5Asiwp++8PIevKBYSgnNLNUZvxAp4a7wMLuKA=' 'sha256-h5LOiLhk6wiJrGsG5ItM0KimwzWQH/yAcmoJDJL//bY='; worker-src *.fastly-insights.com
content-type: text/html; charset=UTF-8
accept-ranges: bytes
date: Sun, 12 Oct 2025 13:36:32 GMT
x-served-by: cache-iad-kiad7000127-IAD, cache-iad-kiad7000127-IAD, cache-bom-vanm7210063-BOM
x-cache: MISS, MISS, MISS
x-cache-hits: 0, 0, 0
x-timer: S1760276193.513703,VS0,VE287
vary: Accept-Encoding
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-frame-options: deny
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
permissions-policy: publickey-credentials-create=(self),publickey-credentials-get=(self),accelerometer=(),ambient-light-sensor=(),autoplay=(),battery=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),execution-while-not-rendered=(),execution-while-out-of-viewport=(),fullscreen=(),gamepad=(),geolocation=(),gyroscope=(),hid=(),identity-credentials-get=(),idle-detection=(),local-fonts=(),magnetometer=(),microphone=(),midi=(),otp-credentials=(),payment=(),picture-in-picture=(),screen-wake-lock=(),serial=(),speaker-selection=(),storage-access=(),usb=(),web-share=(),xr-spatial-tracking=()
content-length: 220
HTTP/2 200
referrer-policy: origin-when-cross-origin
content-security-policy: base-uri 'self'; connect-src 'self' https://api.github.com/repos/ https://api.github.com/search/issues https://gitlab.com/api/ https://analytics.python.org fastly-insights.com *.fastly-insights.com *.ethicalads.io https://api.pwnedpasswords.com https://cdn.jsdelivr.net/npm/mathjax@3.2.2/es5/sre/mathmaps/ https://2p66nmmycsj3.statuspage.io; default-src 'none'; font-src 'self' fonts.gstatic.com; form-action 'self' https://checkout.stripe.com https://billing.stripe.com; frame-ancestors 'none'; frame-src 'none'; img-src 'self' https://pypi-camo.freetls.fastly.net/ *.fastly-insights.com *.ethicalads.io ethicalads.blob.core.windows.net; script-src 'self' https://analytics.python.org *.fastly-insights.com *.ethicalads.io 'sha256-U3hKDidudIaxBDEzwGJApJgPEf2mWk6cfMWghrAa6i0=' https://cdn.jsdelivr.net/npm/mathjax@3.2.2/ 'sha256-1CldwzdEg2k1wTmf7s5RWVd7NMXI/7nxxjJM2C4DqII=' 'sha256-0POaN8stWYQxhzjKS+/eOfbbJ/u4YHO5ZagJvLpMypo='; style-src 'self' fonts.googleapis.com *.ethicalads.io 'sha256-2YHqZokjiizkHi1Zt+6ar0XJ0OeEy/egBnlm+MDMtrM=' 'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=' 'sha256-JLEjeN9e5dGsz5475WyRaoA4eQOdNPxDIeUhclnJDCE=' 'sha256-mQyxHEuwZJqpxCw3SLmc4YOySNKXunyu2Oiz1r3/wAE=' 'sha256-OCf+kv5Asiwp++8PIevKBYSgnNLNUZvxAp4a7wMLuKA=' 'sha256-h5LOiLhk6wiJrGsG5ItM0KimwzWQH/yAcmoJDJL//bY='; worker-src *.fastly-insights.com
content-encoding: gzip
etag: "OkvEPGy71A4DDHg41ZbDjQ"
content-type: text/html; charset=UTF-8
accept-ranges: bytes
date: Sun, 12 Oct 2025 13:36:32 GMT
x-served-by: cache-iad-kcgs7200109-IAD, cache-iad-kcgs7200041-IAD, cache-bom-vanm7210063-BOM
x-cache: MISS, HIT, MISS
x-cache-hits: 0, 9, 0
x-timer: S1760276193.813416,VS0,VE186
vary: Accept-Encoding, Cookie
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-frame-options: deny
x-xss-protection: 1; mode=block
x-content-type-options: nosniff
x-permitted-cross-domain-policies: none
permissions-policy: publickey-credentials-create=(self),publickey-credentials-get=(self),accelerometer=(),ambient-light-sensor=(),autoplay=(),battery=(),camera=(),display-capture=(),document-domain=(),encrypted-media=(),execution-while-not-rendered=(),execution-while-out-of-viewport=(),fullscreen=(),gamepad=(),geolocation=(),gyroscope=(),hid=(),identity-credentials-get=(),idle-detection=(),local-fonts=(),magnetometer=(),microphone=(),midi=(),otp-credentials=(),payment=(),picture-in-picture=(),screen-wake-lock=(),serial=(),speaker-selection=(),storage-access=(),usb=(),web-share=(),xr-spatial-tracking=()
content-length: 12406
parsedatetime · PyPI
Skip to main content
Switch to mobile version
Warning
Some features may not work without JavaScript. Please try enabling it if you encounter problems.
Parse human-readable date/time text.
Project description
Parse human-readable date/time strings.
Python 2.6 or greater is required for parsedatetime version 1.0 or greater.
While we still test with Python 2.6 we cannot guarantee that future changes will not break under 2.6
Installing
You can install parsedatetime using:
pip install parsedatetime
Running Tests
From the source directory:
make test
To run tests on several python versions, type make tox :
$ make tox
[... tox creates a virtualenv for every python version and runs tests inside of each]
py27: commands succeeded
py35: commands succeeded
This assumes that you have the versions you want to test under installed as part of your
PyEnv environment:
pyenv install -s 2.6.9
pyenv install -s 2.7.11
pyenv install -s 3.5.2
pyenv install -s pypy-5.3
pyenv global 2.7.11 3.5.2 2.6.9 pypy-5.3
The tests depend on PyICU being installed using the pyicu-binary package which removes the source build step. PyICU depends on icu4c which on macOS requires homebrew:
brew install icu4c
The Makefile contains the macOS default values for them so you may need to tweak them.
Using parsedatetime
An example of how to use parsedatetime:
import parsedatetime
cal = parsedatetime . Calendar ()
cal . parse ( "tomorrow" )
To get it to a Python datetime object:
from datetime import datetime
time_struct , parse_status = cal . parse ( "tomorrow" )
datetime ( * time_struct [: 6 ])
Parse datetime with timezone support (using pytz package):
import parsedatetime
import pytz
from pytz import timezone
cal = parsedatetime . Calendar ()
datetime_obj , _ = cal . parseDT ( datetimeString = "tomorrow" , tzinfo = timezone ( "US/Pacific" ))
More detailed examples can be found in the examples directory.
Notes
The Calendar class has a member property named ptc which is created during the class init method to be an instance
of parsedatetime_consts.CalendarConstants() .
History
The code in parsedatetime has been implemented over the years in many different languages (C, Clipper, Delphi) as part of different custom/proprietary systems I’ve worked on. Sadly the previous code is not “open” in any sense of that word.
When I went to work for Open Source Applications Foundation and realized that the Chandler project could benefit from my experience with parsing of date/time text I decided to start from scratch and implement the code using Python and make it truly open.
After working on the initial concept and creating something that could be shown to the Chandler folks, the code has now evolved to its current state with the help of the Chandler folks, most especially Darshana.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names .
The dropdown lists show the available interpreters, ABIs, and platforms.
Enable javascript to be able to filter the list of wheel files.
Copy a direct link to the current filters
Copy
File name
Interpreter
Interpreter
py3
ABI
ABI
none
Platform
Platform
any
File details
Details for the file parsedatetime-2.6.tar.gz
.
File metadata
Download URL: parsedatetime-2.6.tar.gz
Upload date:
May 31, 2020
Size: 60.1 kB
Tags: Source
Uploaded using Trusted Publishing? No
Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.3
File hashes
Hashes for parsedatetime-2.6.tar.gz
Algorithm
Hash digest
SHA256
4cb368fbb18a0b7231f4d76119165451c8d2e35951455dfee97c62a87b04d455
Copy
MD5
fb8918fe699d79a470dcd959b77466d7
Copy
BLAKE2b-256
a820cb587f6672dbe585d101f590c3871d16e7aec5a576a1694997a3777312ac
Copy
See more details on using hashes here.
File details
Details for the file parsedatetime-2.6-py3-none-any.whl
.
File metadata
Download URL: parsedatetime-2.6-py3-none-any.whl
Upload date:
May 31, 2020
Size: 42.5 kB
Tags: Python 3
Uploaded using Trusted Publishing? No
Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.8.3
File hashes
Hashes for parsedatetime-2.6-py3-none-any.whl
Algorithm
Hash digest
SHA256
cb96edd7016872f58479e35879294258c71437195760746faffedb692aef000b
Copy
MD5
6ef722742c51574923426015f9a1abcf
Copy
BLAKE2b-256
9da43dd804926a42537bf69fb3ebb9fd72a50ba84f807d95df5ae016606c976c
Copy
See more details on using hashes here.