Add helper function september_now so you can skip the now() call.

Especially so outsiders don't have to write the long call
eternalseptember.september_string(eternalseptember.now(), ...) if
they don't have their own now function.
This commit is contained in:
Ethan Dalool 2020-02-11 17:06:35 -08:00
parent beaa7a47e1
commit 2add4e4ec1

View file

@ -30,6 +30,9 @@ def september_day(date):
days = diff.days + 1
return days
def september_now(strf):
return september_string(now(), strf)
def september_string(date, strf):
'''
Return the ES formatted string for this date.
@ -46,4 +49,4 @@ def september_string(date, strf):
return date.strftime(strf)
if __name__ == '__main__':
print(september_string(now(), '%Y %B %d %H:%M:%S'))
print(september_now('%Y %B %d %H:%M:%S'))