Date Formatter SPCM
A simple Python package to format current dates easily.
Installation
You can install the package using pip:
pip install date_formatter_spcm
Usage
Import the functions from the date_formatter package:
from date_formatter import get_pretty_date, dd_mm_yyyy, mm_dd_yyyy, slash_dd_mm_yyyy, slash_mm_dd_yyyy
# Get the current date in 'Day, Month Date, Year' format
print(get_pretty_date()) # e.g., Monday, July 20, 2026
# Get the current date in 'DD-MM-YYYY' format
print(dd_mm_yyyy()) # e.g., 20-07-2026
# Get the current date in 'MM-DD-YYYY' format
print(mm_dd_yyyy()) # e.g., 07-20-2026
# Get the current date in 'DD/MM/YYYY' format
print(slash_dd_mm_yyyy()) # e.g., 20/07/2026
# Get the current date in 'MM/DD/YYYY' format
print(slash_mm_dd_yyyy()) # e.g., 07/20/2026
from date_formatter import get_past_pretty_date, past_dd_mm_yyyy, past_slash_mm_dd_yyyy
# --- Past Date Functions ---
# Get the date from 5 days ago in 'Day, Month Date, Year' format
print(get_past_pretty_date(5))
# Get the date from 7 days ago in 'DD-MM-YYYY' format
print(past_dd_mm_yyyy(7))
# Get the date from 3 days ago in 'MM/DD/YYYY' format
print(past_slash_mm_dd_yyyy(3))
Features
- get_pretty_date(): Returns the current date like "Monday, July 20, 2026".
- dd_mm_yyyy(): Returns the current date in "DD-MM-YYYY" format.
- mm_dd_yyyy(): Returns the current date in "MM-DD-YYYY" format.
- slash_dd_mm_yyyy(): Returns the current date in "DD/MM/YYYY" format.
- slash_mm_dd_yyyy(): Returns the current date in "MM/DD/YYYY" format.
- get_past_pretty_date(n): Returns the date from n days ago in a pretty format.
- past_dd_mm_yyyy(n): Returns the date from n days ago (DD-MM-YYYY).
- past_mm_dd_yyyy(n): Returns the date from n days ago (MM-DD-YYYY).
- past_slash_dd_mm_yyyy(n): Returns the date from n days ago (DD/MM/YYYY).
- past_slash_mm_dd_yyyy(n): Returns the date from n days ago (MM/DD/YYYY).
How it works
This package is a lightweight wrapper built on top of Python's built-in datetime module to provide human-readable shortcuts for common date formats.
Author
Sara Czasak - sara.p.czasak.m@gmail.com
License
This project is licensed under the MIT License.
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_formatter_spcm-0.0.3.tar.gz.
File metadata
- Download URL: date_formatter_spcm-0.0.3.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e50d23b708d5b87779124004d94fe78d54d11f25f7677de15c4873e3aa4ae03
|
|
| MD5 |
61b501f9a45c16a61e80e84cd608b806
|
|
| BLAKE2b-256 |
6357f1601ad6dd995aeb820ce9ada3a449b29661cb083a36a32b6c10e5a94bc4
|
File details
Details for the file date_formatter_spcm-0.0.3-py3-none-any.whl.
File metadata
- Download URL: date_formatter_spcm-0.0.3-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c05e47c3d4f939fd461dadbeda7a12247d5a52fdbc5bf445b00c0d83abaaa35
|
|
| MD5 |
47add666d0aab997785df26bc0c89e94
|
|
| BLAKE2b-256 |
59ef77262a81d5d8c85008294d6dd55be30f4bf372f153b935ae567419b81000
|