UnknownTimeZoneError
This commit is contained in:
parent
9f79e59a95
commit
0c0028a9d3
1 changed files with 4 additions and 1 deletions
|
@ -344,7 +344,10 @@ class FilenameGenerator:
|
||||||
time_datetime = datetime.datetime.now()
|
time_datetime = datetime.datetime.now()
|
||||||
|
|
||||||
time_format = args[0] if len(args) > 0 else self.default_time_format
|
time_format = args[0] if len(args) > 0 else self.default_time_format
|
||||||
|
try:
|
||||||
time_zone = pytz.timezone(args[1]) if len(args) > 1 else None
|
time_zone = pytz.timezone(args[1]) if len(args) > 1 else None
|
||||||
|
except pytz.exceptions.UnknownTimeZoneError as _:
|
||||||
|
time_zone = None
|
||||||
|
|
||||||
time_zone_time = time_datetime.astimezone(time_zone)
|
time_zone_time = time_datetime.astimezone(time_zone)
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue