Relative To Now
Convert date/time into a string relative to now.
💾 Install
python -m pip install relative-to-now
# or
poetry add relative-to-now
✨ How to Use
Possible input types:
- time.time()
- datetime.date.today()
- datetime.datetime.now()
Optional inputs:
no_errors(Defaults toFalse, set toTrueto return value when there is an error instead of raising)
Output:
Examples:
import datetime
from RelativeToNow import relative_to_now
print(relative_to_now(datetime.datetime.now() + datetime.timedelta(days=1)))
>>> 1 day from now
Precision for datetime.date is days.
import datetime
from RelativeToNow import relative_to_now
print(relative_to_now(datetime.date.today() - datetime.timedelta(days=2)))
>>> 2 days ago
import time
from RelativeToNow import relative_to_now
print(relative_to_now(time.time()))
>>> just now
Metadata
Release files for relative-to-now 1.1.0
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 |
|---|---|---|---|---|
| relative_to_now-1.1.0.tar.gz | 15.1 kB | Without provenance | Details for relative_to_now-1.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| relative_to_now-1.1.0-py3-none-any.whl | Python 3 | none | any | Details for relative_to_now-1.1.0-py3-none-any.whl |
Total release size: 30.3 kB
Release files / relative_to_now-1.1.0.tar.gz
| Download URL | relative_to_now-1.1.0.tar.gz |
|---|---|
| Size | 15.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c3c4a8963a3b823c3d8415a96f75226d617ef378c6d5e6c94cddb9eccdf8820a
|
|
BLAKE2b-256 checksum How to use checksums |
fdfb1790f745b5d01d52d4d1864e784ddebf9b25bfb8fd3aebc1261b83f4a793
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.0 Linux/5.15.0-1030-azure
|
Release files / relative_to_now-1.1.0-py3-none-any.whl
| Download URL | relative_to_now-1.1.0-py3-none-any.whl |
|---|---|
| Size | 15.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88bd05d363bdd2007ec96edf0e3a8dc5cbbb248ec5d42e7322bc888252d7f6e1
|
|
BLAKE2b-256 checksum How to use checksums |
02216a2a467c2ef6c3c2e259a9e02cfffb695ac1163659b8ba0e69bb8a9c15ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.3.2 CPython/3.11.0 Linux/5.15.0-1030-azure
|
Security for relative-to-now 1.1.0
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.