ranaroussi / yfinance

Download market data from Yahoo! Finance's API
https://aroussi.com/post/python-yahoo-finance
Apache License 2.0
12.24k stars 2.23k forks source link

Fix: datetime.datetime.utcnow() is deprecated ... #1922

Closed ValueRaider closed 1 month ago

ValueRaider commented 1 month ago

I upgraded Python 3.11 -> 3.12 and get this new warning:

DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).

Simple to fix.

ValueRaider commented 1 month ago

~Problem: breaks if Python older than 3.11.~ Solved