I'm running this Python code to get historical candlestick data from the Binance API:
from binance.client import Client
api_key = "my api key"
api_secret = "my secret key"
client = Client(api_key, api_secret)
klines = client.get_historical_klines("BTCUSDT", Client.KLINE_INTERVAL_1MINUTE, "1 Hour ago")
print(klines)
and it gets data going up to one hour ago. By default it's set on the UTC time zone, but since my systems time zone is UTC+1, it doesn't work, and I get this error:
ValueError: Timezone offset does not match system offset: -25200 != -28800. Please, check your config files.
so instead of using "1 Hour ago"
, I use "1 Hour ago UTC+1"
which works... but it doesn't get the data of the last hour (which is the data I need), I figured it was somehow because of the 1 hour offset between UTC and UTC+1, and one solution would be to change my Computers timezone to UTC, but I don't want to do that.
So... I really don't know what to do, I've searched about this issue online, but I've found no solutions, Stack Overflow is my last hope.
Edit: just tried changing my systems timezone to see if it would make any difference, but it doesn't.