To estimate the day of the week from date/month/year info
Project description
# DATE DAY PREDICTOR
date_day_estimator is a Python package that calculates the day of the week for a given date using Zeller’s Congruence.
## Installation
`bash pip install date-day-estimator `
## Usage
from date_day_estimator.date_day_estimator import zellers_congruence
# Example: Find the day of the week for 5th July 1995 day_number, day_name = zellers_congruence(5, 7, 1995)
print(day_number) # 4 print(day_name) # ‘Wednesday’
## FORMULA
Zeller’s Congruence, which is an algorithm used to calculate the day of the week for any given date. It typically takes the following form:
[ h = left(q + leftlfloor rac{13(m+1)}{5} ight floor + K + leftlfloor rac{K}{4} ight floor + leftlfloor rac{J}{4} ight floor - 2J ight) mod 7 ]
Where: - ( h ) is the day of the week (0 = Saturday, 1 = Sunday, 2 = Monday, etc.), - ( q ) is the day of the month, - ( m ) is the month (March = 3, April = 4, …, February = 14), - ( K ) is the year of the century (i.e., year % 100), - ( J ) is the zero-based century (i.e., year // 100).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file date_day_estimator-0.0.4.tar.gz.
File metadata
- Download URL: date_day_estimator-0.0.4.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1677aec9c763fc75b3a4675741724b725700f759a5e49c4c639b4088604ed33a
|
|
| MD5 |
96e8501247177dea9a2c3a1047bdc272
|
|
| BLAKE2b-256 |
46a5b09462c121f71e3cfd6ec265414312f58e8f627045aad9481795bd84595a
|
File details
Details for the file date_day_estimator-0.0.4-py3-none-any.whl.
File metadata
- Download URL: date_day_estimator-0.0.4-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
880fa7bf5be2a367886a4595a2ce6de653015d52ac16fac50f22b5e9a5efadac
|
|
| MD5 |
5b205f927b9c472ce23e30852e8062a8
|
|
| BLAKE2b-256 |
81c7a23d24cb0dcb8a323327e2165b2d9f28fd704a73e670107424cd0dec9042
|