Timezone handling tweak.

This commit is contained in:
Chris Berkhout 2024-09-15 13:15:18 +02:00
parent c78154df3a
commit dffe6f8e89

View file

@ -89,11 +89,7 @@ class Yahoo(BaseSource):
return dataclasses.replace(series, quote=quote, prices=prices) return dataclasses.replace(series, quote=quote, prices=prices)
def _date_from_ts(self, ts, offset) -> str: def _date_from_ts(self, ts, offset) -> str:
return ( return datetime.fromtimestamp(ts - offset).strftime("%Y-%m-%d")
datetime.fromtimestamp(ts - offset)
.replace(tzinfo=timezone.utc)
.strftime("%Y-%m-%d")
)
def _amount(self, amounts, type, i): def _amount(self, amounts, type, i):
if type == "mid" and amounts["high"] != "null" and amounts["low"] != "null": if type == "mid" and amounts["high"] != "null" and amounts["low"] != "null":