Jul-28-2022, 05:15 AM
Help convert UTC time to local. Here is a getter function that outputs the time in UTC in columns.
def getminutedata(symbol, interval, lookback): frame = pd.DataFrame(client.get_historical_klines(symbol, interval, lookback + 'min ago UTC')) frame = frame.iloc[:,:6] frame.columns = ['Time', 'Open', 'High', 'Low', 'Close', 'Volume'] frame = frame.set_index('Time') frame.index = pd.to_datetime(frame.index, unit='ms') frame = frame.astype(float) return frameI've tried to change time in three ways, using pandas, dateutil and pytz, but nothing worked, not enough knowledge in Python. Knowledgeable people help write down the necessary lines of code to change time. Thank you in advance.

