public
Description: python module for parsing english textual date descriptions
Homepage:
Clone URL: git://github.com/schmir/timelib.git
name age message
file .gitignore Wed Jun 24 05:00:02 -0700 2009 more ignores [schmir]
file MANIFEST.in Wed Jun 24 05:19:04 -0700 2009 if setuptools is available, try to use it and p... [schmir]
file Makefile Wed Jun 24 03:33:46 -0700 2009 add target for re2c generated file [schmir]
file README.txt Thu Nov 12 06:09:43 -0800 2009 license information [Ralf Schmitt]
directory ext-date-lib/ Wed Jun 24 03:29:01 -0700 2009 remove parse_date.c.orig [schmir]
file setup.py Thu Nov 12 06:13:23 -0800 2009 up version to 0.2.1 [Ralf Schmitt]
file test_timelib.py Wed Jun 24 05:07:30 -0700 2009 test epoch [schmir]
file timelib.pyx Thu Nov 12 06:13:23 -0800 2009 up version to 0.2.1 [Ralf Schmitt]
file timelib_config.h Tue Jun 23 06:23:21 -0700 2009 first version. only provides timelib.strtotime [Ralf Schmitt]
README.txt
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'

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 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.


.. _php license: http://www.php.net/license/3_01.txt