mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-13 03:33:55 +00:00
updated timezone.utc time
This commit is contained in:
parent
bb2a44735b
commit
1414df5e27
|
@ -615,7 +615,7 @@ class LocalTrade():
|
||||||
raise OperationalException(f"Leverage not available on {self.exchange} using freqtrade")
|
raise OperationalException(f"Leverage not available on {self.exchange} using freqtrade")
|
||||||
|
|
||||||
open_date = self.open_date.replace(tzinfo=None)
|
open_date = self.open_date.replace(tzinfo=None)
|
||||||
now = (self.close_date or datetime.utcnow()).replace(tzinfo=None)
|
now = (self.close_date or datetime.now(timezone.utc)).replace(tzinfo=None)
|
||||||
sec_per_hour = Decimal(3600)
|
sec_per_hour = Decimal(3600)
|
||||||
total_seconds = Decimal((now - open_date).total_seconds())
|
total_seconds = Decimal((now - open_date).total_seconds())
|
||||||
hours = total_seconds/sec_per_hour or zero
|
hours = total_seconds/sec_per_hour or zero
|
||||||
|
|
Loading…
Reference in New Issue
Block a user