No project description provided
Project description
date-operations
Usage
Get days, months or years between 2 dates
With these functions you get the amount of days, months or years between 2 days. In the case of months and years, there needs to be a full month or year between the dates in order to make it count:
from date_operations import (
days_between,
months_between,
years_between,
)
days_between("2023-01-01", "2023-01-02") # 1
months_between("2023-01-01", "2023-02-01") # 1
months_between("2023-01-31", "2023-02-01") # 0
years_between("2023-01-01", "2024-01-01") # 1
years_between("2023-12-31", "2024-01-01") # 0
Get months or years started between 2 dates
If you need to know how many months or years have started between 2 dates (not caring about full months or years), these are the functions to use:
from date_operations import (
months_started_between,
years_started_between,
)
months_started_between("2023-01-01", "2023-02-01") # 1
months_started_between("2023-01-31", "2023-02-01") # 1
years_started_between("2023-01-01", "2024-01-01") # 1
years_started_between("2023-12-31", "2024-01-01") # 1
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 Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for date_operations-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92b78fb652be8d03e187f0fde187ae9ff6ab47c8679d75b6385bc1e4fba25985 |
|
MD5 | e2616183e0a7027794a98296b7a95976 |
|
BLAKE2b-256 | 063f3b36ad948076cf701cd35ec55001428365e138e19c1d1c0e20b6ddd8f00c |