Adjust gti

This commit is contained in:
Dusty.P 2018-06-03 23:50:16 -08:00
parent 70dbc350c2
commit 55fb9ae3e7

View File

@ -486,8 +486,12 @@ class Utils:
else:
em.set_footer(text='Valid timezone not found in time string. Using UTC...')
parsed_tz = pytz.timezone('UTC')
in_time = parse(time.upper())
in_time = parsed_tz.localize(in_time)
if not time.isspace() and not time == '':
in_time = parse(time.upper())
in_time = parsed_tz.localize(in_time)
else:
em.set_footer(text='Time not given. Using current time.')
in_time = parsed_tz.localize(datetime.utcnow())
except ValueError:
raise commands.CommandError(f'For some reason I can\'t parse this time string: \n'
f'{orig_time} {time} {parsed_tz}\n'