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-1.x.x-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.
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 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.
Metadata
Release files for convertToDecimalTime 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| convertToDecimalTime-1.0.2.tar.gz | 3.1 kB | Without provenance | Details for convertToDecimalTime-1.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| convertToDecimalTime-1.0.2-py3-none-any.whl | Python 3 | none | any | Details for convertToDecimalTime-1.0.2-py3-none-any.whl |
Total release size: 6.7 kB
Release files / convertToDecimalTime-1.0.2.tar.gz
| Download URL | convertToDecimalTime-1.0.2.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2c6176142530c65656170f3a0184f3215f778851042117f7606f47bd9fb6b54a
|
|
BLAKE2b-256 checksum How to use checksums |
3dc2ff70939554a9a106c25cf1aab72428a91a78fab8ef987c7bd7cb0d46d7a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Release files / convertToDecimalTime-1.0.2-py3-none-any.whl
| Download URL | convertToDecimalTime-1.0.2-py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a60c7fd06613cfe50ea92051fd5c692cebe35905396911a4e8e9721be5d410e
|
|
BLAKE2b-256 checksum How to use checksums |
31f6c6bacb143616658add10651a976e370ffe90f67820caa2930289962e0699
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.12
|
Security for convertToDecimalTime 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.