Print a datetimes distance from now
Project description
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()
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
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
relative_to_now-0.0.2.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for relative_to_now-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cfd8b67770cc43861eda6211d20c7c606d2a297bc89e9874f6973f8a3798cea2 |
|
MD5 | 12c977f1068be2b3eaa656ffa37b8408 |
|
BLAKE2b-256 | 92893b34ad4626a22d5a2c140a138852e3eb8e636a1b37b76271d7c8750dd097 |