Skip to main content

parse english textual date descriptions

Project description

Usage

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'

Build

To build timelib, first create a virtual environment, then run the following command:

pip install –upgrade build pip python -m build

License

ext-date-lib contains unmodified sources from the php source distribution. These are distributed under the php license, version 3.01.

The remaining part is distributed under the zlib/libpng license:

Copyright (c) 2009-2011 PediaPress GmbH

This software is provided ‘as-is’, without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.

  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.

  3. This notice may not be removed or altered from any source distribution.

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

Uploaded Source

Built Distribution

timelib-0.3.0-cp39-cp39-macosx_12_0_arm64.whl (175.0 kB view details)

Uploaded CPython 3.9 macOS 12.0+ ARM64

File details

Details for the file timelib-0.3.0.tar.gz.

File metadata

  • Download URL: timelib-0.3.0.tar.gz
  • Upload date:
  • Size: 308.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for timelib-0.3.0.tar.gz
Algorithm Hash digest
SHA256 d1b22706557186e6058da88ba0f85837401b2ae9de157f59353dc978d825187a
MD5 868ad4e094dd71152a77b347f25ffc06
BLAKE2b-256 a4ffa0982fbbc36a5edd734126a149b8e8f9cb6e4d80f9b01b181056b47ee655

See more details on using hashes here.

File details

Details for the file timelib-0.3.0-cp39-cp39-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for timelib-0.3.0-cp39-cp39-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 7d9ea8e45f310503d62f5c06db2d39d1a7b88fbbd142c603d9587ee6c738858b
MD5 ef66c82f9d0312dbdf229f50cd6a2135
BLAKE2b-256 ca81da3c6f0ed0cd18946a875094d83d4089c32ccf9d0bca0d5636422615fde0

See more details on using hashes here.

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