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:
Scott Sanderson
2014-11-18 16:54:04 -05:00
parent eaea8e5317
commit 44f993c64e
+1 -1
View File
@@ -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):