Skip to content

Instantly share code, notes, and snippets.

@eelfroth
Created May 7, 2019 17:52
Show Gist options
  • Save eelfroth/4545eb57e51a89851fc732728fe40dea to your computer and use it in GitHub Desktop.
Save eelfroth/4545eb57e51a89851fc732728fe40dea to your computer and use it in GitHub Desktop.
ddate in YYMDD format
#!/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