GithubHelp home page GithubHelp logo

thomst / daytime Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 12 KB

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.

Python 100.00%

daytime's Introduction

daytime

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

daytime's People

Contributors

thomst avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.