Giter Site home page Giter Site logo

tolissth / converttodecimaltime Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 1.0 14 KB

A python library about converting standard time to decimal time.

Home Page: https://pypi.org/project/convertToDecimalTime/

License: MIT License

Python 100.00%
decimaltime timeconvert standardtime

converttodecimaltime's Introduction

Convert to decimal time

A small python library to convert standard time to decimal time.

What is decimal time

Decimal time is the representation of the time of day using units which are decimally related. Essentially decimal times operates with powers of 10.

  • DTs = Decimal Time second
  • DTm = Decimal Time minute
  • DTh = Decimal Time hour This classification is unofficial
Unit Decimal Time Equivalent in SI seconds
Seconds 1 DTs 0.864
Minutes 1 DTm 86.4
Hours 1 DTh 8,640

Functions

The following are the descriptions of the functions and their required input.

  • getSeconds: Takes an int argument that represents the SI seconds and returns an int that represents the DT seconds.
  • getMinutes: Takes an int argument that represents the SI seconds and returns an int that represents the DT minutes.
  • getHours: Takes an int argument that represents the SI seconds and returns an int that represents the DT hours.
  • getTimeNow: Gets the system time and returns an array that contains the current hours, minutes and seconds in DT.

Example usage

After you install the library using the command pip install /path/to/file/convertToDecimalTime_TolisSth-1.0.0-py3-none-any.whl or pip install convertToDecimalTime, you can start using the library writing scripts like the following:

from convertToDecimalTime import getMinutes

x = int(input("Minutes: ")) 
print("Minutes: ", getMinutes(x)) 

output: Let's say that my input is 3600, the output will be: Minutes: 41.

Motivation for this project

The motivation for this small project came from an article featured on Hacker news that contained a link to the wikipedia article for decimal time. Decimal time is not widely used and that's why there was no library to handle the conversions. It is likely that this library won't be used anywhere because of how little decimal time is used but it is great to always have the option.

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.