Sfoglia il codice sorgente

tau: fix a bug in archive command that made the intended month be older by one month

dasman 1 anno fa
parent
commit
053942f101
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      bin/tau/tau-python/lib/util.py

+ 3 - 1
bin/tau/tau-python/lib/util.py

@@ -13,7 +13,9 @@ def now():
 def month_to_unix(month=None):
     month_year = month if month is not None else datetime.now(UTC).strftime("%m%y")
     try:
-        unix = int(datetime.strptime(month_year,"%m%y").timestamp())
+        dt = datetime.strptime(month_year,"%m%y")
+        dt = dt.replace(tzinfo=UTC)
+        unix = int(dt.timestamp())
     except ValueError:
         print("Error parsing date!")
         exit(-1)