From 2add4e4ec19fb7b9f6830eb1d7a36236b9679297 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Tue, 11 Feb 2020 17:06:35 -0800 Subject: [PATCH] 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. --- voussoirkit/eternalseptember.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/voussoirkit/eternalseptember.py b/voussoirkit/eternalseptember.py index 18f54bb..bdcdf48 100644 --- a/voussoirkit/eternalseptember.py +++ b/voussoirkit/eternalseptember.py @@ -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'))