https://github.com/ntbbloodbath/seconds
Transform seconds to minutes, hours, etc. and vice versa quickly, easily, understandable by humans and without external dependencies
https://github.com/ntbbloodbath/seconds
python python3 seconds time
Last synced: 9 months ago
JSON representation
Transform seconds to minutes, hours, etc. and vice versa quickly, easily, understandable by humans and without external dependencies
- Host: GitHub
- URL: https://github.com/ntbbloodbath/seconds
- Owner: NTBBloodbath
- License: mit
- Created: 2020-12-06T16:54:45.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-09T21:12:27.000Z (over 5 years ago)
- Last Synced: 2025-09-14T07:39:51.436Z (9 months ago)
- Topics: python, python3, seconds, time
- Language: Python
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README



[](https://pepy.tech/project/seconds)

Seconds is a utility package to transform seconds to minutes, hours, etc. and vice versa
quickly, easily, understandable by humans and without external dependencies
so its performance is excellent and it's extremely lightweight!
------
## Why use Seconds?
Since Seconds doesn't contain external dependencies, it's extremely lightweight (only 12kB!)
and very fast, it becomes the perfect tool to manage and transform time!
------
# Quick start
## Installation
Seconds requires Python 3.x and can be installed through `pip` with the following command.
```sh
pip3 install -U seconds
# Or from github's latest commit
# Available branches:
# • master
pip3 install -U git+https://github.com/NTBBloodbath/Seconds@branch
```
## Usage example
This is a brief example of Secs.
```py
# Lets import Secs class from Seconds Package
from seconds import Secs
# Lets pass 5 minutes to seconds and seconds to 10 minutes
Secs("5m") # => 300
Secs(600) # => 10 minutes
# But we want to abbreviate our minutes so we
# will pass the abbrev parameter to options
Secs(600, abbrev=True) # => 10m
# Lets pass 6 months to seconds and then pass 1 year to seconds
Secs("6mo") # => 110451600
Secs("1y") # => 220903200
```
## Documentation
You can see the Seconds documentation through the `help()` function of the REPL.
------
# License
**Seconds is distributed under MIT License.**
# Contributing
You can see how to contribute [here](./CONTRIBUTING.md)
# Code of Conduct
You can see the code of conduct [here](./CODE_OF_CONDUCT.md)