Skip to main content

Extension for datetime.time with the main focus on comarison an making sums.

Project description

This module extends the datetime.time-module and makes it more handy respectivly to comparison, addition and substraction. You can compare, add and substract a daytime with another daytime, a datetime.time-object or an int or float as total amount of seconds. Making sums is also possible with a datetime.timedelta.

Latest Version

The latest version of this project can be found at : http://github.com/thomst/daytime.

Installation

  • Option 1 : Install via pip

    pip install daytime
  • Option 2 : If you have downloaded the source

    python setup.py install

Documentation

How to use?

from daytime import DayTime
import datetime

daytime1 = DayTime(2, 20, 23, 90000)
daytime2 = DayTime(12, 25, 0, 8400)

daytime1 - daytime2                 # DayTime(13, 55, 23, 81600)
daytime2 + datetime.time(22,3,4,5)  # DayTime(10, 28, 4, 8405)
daytime1 - 12400                    # DayTime(22, 53, 43, 90000)

daytime1 < daytime2                 # True
daytime2 > 4800                     # True

DayTime.utcfromtimestamp(24000.4)   # DayTime(6, 40, 0, 400000)

Reporting Bugs

Please report bugs at github issue tracker: https://github.com/thomst/daytime/issues

Author

thomst <thomaslfuss@gmx.de> Thomas Leichtfuß

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

daytime-0.3.tar.gz (2.0 kB view details)

Uploaded Source

File details

Details for the file daytime-0.3.tar.gz.

File metadata

  • Download URL: daytime-0.3.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for daytime-0.3.tar.gz
Algorithm Hash digest
SHA256 159d9152ab80074673b9dc2e46ad11206388a2c5aa9c298fa4ae4e4f2d254498
MD5 e32f4ae673bae610f8f7f06585946b94
BLAKE2b-256 8d290c73e6d87d9a82b32b89e73191f16f1fd5b116e7bf17a3120c42ab6db5b6

See more details on using hashes here.

Provenance

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