Skip to main content

wrapper for timelib

Project description

Fork of: https://github.com/pediapress/timelib/

Usage

strtotime is a short wrapper around php’s internal timelib module. It currently only provides a few functions:

strtotime.strtodatetime:

>>> strtotime.strtodatetime('today')
datetime.datetime(2009, 6, 23, 0, 0)
>>> strtotime.strtodatetime('today')
datetime.datetime(2009, 6, 23, 0, 0)
>>> strtotime.strtodatetime('next friday')
datetime.datetime(2009, 6, 26, 0, 0)
>>> strtotime.strtodatetime('29 feb 2008 -108 years')
datetime.datetime(1900, 3, 1, 0, 0)

strtotime.strtotime:

>>> import time, strtotime
>>> time.ctime(strtotime.strtotime("now"))
'Tue Jun 23 15:17:32 2009'
>>> time.ctime(strtotime.strtotime("4 hours ago"))
'Tue Jun 23 11:17:38 2009'
>>> time.ctime(strtotime.strtotime("20080229 -1 year"))
'Thu Mar  1 01:00:00 2007'

License

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


Release history Release notifications

This version

1.0.3

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for strtotime, version 1.0.3
Filename, size File type Python version Upload date Hashes
Filename, size strtotime-1.0.3-cp34-cp34m-manylinux1_x86_64.whl (454.9 kB) File type Wheel Python version cp34 Upload date Hashes View
Filename, size strtotime-1.0.3-cp35-cp35m-manylinux1_x86_64.whl (457.1 kB) File type Wheel Python version cp35 Upload date Hashes View
Filename, size strtotime-1.0.3-cp36-cp36m-manylinux1_x86_64.whl (460.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size strtotime-1.0.3-cp37-cp37m-manylinux1_x86_64.whl (461.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size strtotime-1.0.3.zip (598.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page