mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-04 11:19:01 +08:00
ENH: Add a utility to reverse a utc timestamp to dst.
Mirror the exchange_dt_in_exchange helper function. Useful for inspecting data interactively.
This commit is contained in:
@@ -122,6 +122,10 @@ class TradingEnvironment(object):
|
||||
tzinfo=pytz.utc
|
||||
)
|
||||
|
||||
def utc_dt_in_exchange(self, dt):
|
||||
delorean = Delorean(dt, pytz.utc.zone)
|
||||
return delorean.shift(self.exchange_tz).datetime
|
||||
|
||||
def exchange_dt_in_utc(self, dt):
|
||||
delorean = Delorean(dt, self.exchange_tz)
|
||||
return delorean.shift(pytz.utc.zone).datetime
|
||||
|
||||
Reference in New Issue
Block a user