From 1414df5e27ea5886888a751919e794705015e06a Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Tue, 6 Jul 2021 00:18:03 -0600 Subject: [PATCH] updated timezone.utc time --- freqtrade/persistence/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freqtrade/persistence/models.py b/freqtrade/persistence/models.py index 415024018..5254b7f4b 100644 --- a/freqtrade/persistence/models.py +++ b/freqtrade/persistence/models.py @@ -615,7 +615,7 @@ class LocalTrade(): raise OperationalException(f"Leverage not available on {self.exchange} using freqtrade") 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) total_seconds = Decimal((now - open_date).total_seconds()) hours = total_seconds/sec_per_hour or zero