Browse Source

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

dasman 1 year ago
parent
commit
053942f101
1 changed files with 3 additions and 1 deletions
  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):
 def month_to_unix(month=None):
     month_year = month if month is not None else datetime.now(UTC).strftime("%m%y")
     month_year = month if month is not None else datetime.now(UTC).strftime("%m%y")
     try:
     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:
     except ValueError:
         print("Error parsing date!")
         print("Error parsing date!")
         exit(-1)
         exit(-1)