datetime.timedelta replacement
Project description
Install
$ [sudo] pip install timedelta
Classes
timedelta.Timedelta
datetime.timedelta replacement
timedelta.Total
method | description |
---|---|
__init__(total_seconds) |
init from total seconds count |
@property | description |
---|---|
days |
return total days count |
hours |
return total hours count |
minutes |
return total minutes count |
seconds |
return total seconds count |
Examples
>>> import timedelta
>>> td = timedelta.Timedelta(days=2, hours=2)
# init from datetime.timedelta
>>> td = timedelta.Timedelta(datetime1 - datetime2)
total
seconds, minutes, hours, days
>>> td = timedelta.Timedelta(days=2, hours=2)
>>> td.total.seconds
180000
>>> td.total.minutes
3000
>>> td.total.hours
50
>>> td.total.days
2
Links
readme-md - README.md generator
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
timedelta-2018.11.20.tar.gz
(1.6 kB
view hashes)
Built Distribution
Close
Hashes for timedelta-2018.11.20-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0232bb4a01b8a403b54b444f137c0c150ffdb868e347cbbee711bd1828fce872 |
|
MD5 | 228cb0c6209a5e2ec5ba16a070fd9437 |
|
BLAKE2b-256 | 66f7992c752ae72d0be0c8c61330a6ed54051598aee6f3c0c2ecd0db7e0f9f65 |