BinanceAPIException: APIError(code=-1021): Timestamp for this request is not valid.
Hi,
I ended up with having my signed requests rejected due to an invalid timestamp!
Anyone experienced the same issue?
Thanks
I am, on this line
order = client.get_my_trades(symbol=symbol)
but on this line it works
prices = client.get_ticker()
Sorry, didn´t see the other issue
This is my solution for timestamps issue. The code made equal windows time to binance server time.
from binance.client import Client client = Client('api_key', 'api_secret') import time import win32api gt = client.get_server_time() aa = str(gt) bb = aa.replace("{'serverTime': ","") aa = bb.replace("}","") gg=int(aa) ff=gg-10799260 uu=ff/1000 yy=int(uu) tt=time.localtime(yy) win32api.SetSystemTime(tt[0],tt[1],0,tt[2],tt[3],tt[4],tt[5],0)
"The integer 10799260 for adjusting time zone and fine tuning for miliseconds."