Created
February 25, 2022 16:11
-
-
Save knoxilla/249990f2e5ac7f6148b7c3301975f07f to your computer and use it in GitHub Desktop.
mdate - Endless March
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
"""Endless March""" | |
from datetime import datetime | |
import subprocess | |
actual_date = subprocess.run("date",capture_output=True, text=True) | |
actual_date_parts = actual_date.stdout.split() | |
today = datetime.now() | |
then = datetime(day=1, month=3, year=2020) | |
timedelta = today - then | |
actual_date_parts[1] = 'Mar' | |
actual_date_parts[2] = f"{timedelta.days + 1}" | |
actual_date_parts[5] = '2020' | |
tweaked_date = " ".join(actual_date_parts) | |
print(tweaked_date) |
Author
knoxilla
commented
Feb 25, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment