-
-
Save eelfroth/4545eb57e51a89851fc732728fe40dea to your computer and use it in GitHub Desktop.
ddate in YYMDD format
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
#!/usr/bin/python2 | |
#pip install ddate | |
from ddate.base import DDate | |
def ddt(): | |
dd = DDate() | |
day = str(dd.day_of_season).zfill(2) | |
SEASONS = { 0: "C", 1: "D", 2: "V", 3: "B", 4: "A"} | |
season = SEASONS[dd.season] | |
year = str(dd.year)[-2:] | |
return year+season+day | |
if __name__ == '__main__': | |
print ddt() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment