Library to assisth standard to decimal time converions
Project description
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
, you can start using the library writing scripts like the following:
from convert 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
.
Motiation 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 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.
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
Built Distribution
Hashes for convertToDecimalTime-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | edfe56af76df70e32a17ce29b9b6cd2f69d5f3ec62424fc5a39c346bfb6d24a1 |
|
MD5 | bb47936b959cb8b387dff31b1c949de2 |
|
BLAKE2b-256 | 02b13fb04940ebeb9388e0299c73ad2755543f4eb3b01f1b1e3f3cf9f92a46a6 |
Hashes for convertToDecimalTime-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73b462a419fd0c84fdf83b7d841e9a0977494fd4f6fa0d9e736d2e8371444f0b |
|
MD5 | 88a24f3d23797cbb040f1735c0787300 |
|
BLAKE2b-256 | 80c4d48e97186e94597ed75c5c086c611b2c37908d9b8eb228a666156dfcb228 |