Last active
March 10, 2020 23:54
-
-
Save gchavez2/3b5f39d607f1bbb2da527d350eaa1d61 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
""" | |
y2k | |
19016 -> 01/23/2020 | |
0 = 12/31/1967 | |
1 = 01/01/1968 | |
""" | |
import sys | |
from datetime import datetime, timedelta | |
if len(sys.argv) != 2: | |
sys.exit('Enter sequence number <int>') | |
sequence = int(sys.argv[1]) | |
if isinstance(sequence, int): | |
specific_date = datetime(1967, 12, 31) | |
new_date = specific_date + timedelta(sequence) | |
print(new_date.strftime("%Y-%m-%d")) | |
else: | |
print('Enter sequence number <int>') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment