mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-01 01:41:53 +08:00
DEV: Explicitly convert string to timezones in get_datetime.
This commit is contained in:
@@ -784,6 +784,8 @@ class TradingAlgorithm(object):
|
||||
assert date_copy.tzinfo == pytz.utc, \
|
||||
"Algorithm should have a utc datetime"
|
||||
if tz is not None:
|
||||
if isinstance(tz, basestring):
|
||||
tz = pytz.timezone(tz)
|
||||
date_copy = date_copy.astimezone(tz)
|
||||
return date_copy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user