mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-06 04:58:18 +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:
@@ -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