parse english textual date descriptions
Project description
timelib is a short wrapper around php’s internal timelib module. It currently only provides a few functions:
timelib.strtodatetime:
>>> timelib.strtodatetime('today')
datetime.datetime(2009, 6, 23, 0, 0)
>>> timelib.strtodatetime('today')
datetime.datetime(2009, 6, 23, 0, 0)
>>> timelib.strtodatetime('next friday')
datetime.datetime(2009, 6, 26, 0, 0)
>>> timelib.strtodatetime('29 feb 2008 -108 years')
datetime.datetime(1900, 3, 1, 0, 0)
timelib.strtotime:
>>> import time, timelib
>>> time.ctime(timelib.strtotime("now"))
'Tue Jun 23 15:17:32 2009'
>>> time.ctime(timelib.strtotime("4 hours ago"))
'Tue Jun 23 11:17:38 2009'
>>> time.ctime(timelib.strtotime("20080229 -1 year"))
'Thu Mar 1 01:00:00 2007'
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
timelib-0.2.tar.gz
(289.5 kB
view details)
File details
Details for the file timelib-0.2.tar.gz.
File metadata
- Download URL: timelib-0.2.tar.gz
- Upload date:
- Size: 289.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f0e6befb2792c22de6763b810ef6264493536f4cd49a2466adefca9c06dbf4b
|
|
| MD5 |
08a4e484c7ae35f32338e762b1995d41
|
|
| BLAKE2b-256 |
ee2678c27b2774ea8b3edf4e0ce4e67564428dbf653ee54a3fdbaa71bf833936
|