mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-29 13:00:42 +08:00
BUG: Use astimezone instead of tz_convert.
Makes get_datetime agnostic as to whether its input is a datetime or a Timestamp. (astimezone is an alias to tz_convert when the input is a Timestamp).
This commit is contained in:
1 parent
eaea8e5317
commit
44f993c64e
1 file changed
+1
-1
@@ -784,7 +784,7 @@ class TradingAlgorithm(object):
|
||||
assert date_copy.tzinfo == pytz.utc, \
|
||||
"Algorithm should have a utc datetime"
|
||||
if tz is not None:
|
||||
date_copy = date_copy.tz_convert(tz)
|
||||
date_copy = date_copy.astimezone(tz)
|
||||
return date_copy
|
||||
|
||||
def set_transact(self, transact):
|
||||
|
||||
Reference in new issue
Block a user