Invalid Timestamp Issue
Hi, Sorry, to generate the same issue. But i have tried all solutions mentioned but no luck. I have one doubt. my account is unverified on binance, can that be the reason for this issue?
local1: 1507741266414 server:1507741240901 local2: 1507741266522 diff1:-25513 diff2:25621 local1: 1507741268524 server:1507741243017 local2: 1507741268639 diff1:-25507 diff2:25622 local1: 1507741270641 server:1507741245133 local2: 1507741270755 diff1:-25508 diff2:25622 local1: 1507741272758 server:1507741247245 local2: 1507741272865 diff1:-25513 diff2:25620 local1: 1507741274867 server:1507741249355 local2: 1507741274975 diff1:-25512 diff2:25620 local1: 1507741276977 server:1507741251469 local2: 1507741277091 diff1:-25508 diff2:25622 local1: 1507741279094 server:1507741253585 local2: 1507741279208 diff1:-25509 diff2:25623 local1: 1507741281210 server:1507741255701 local2: 1507741281324 diff1:-25509 diff2:25623 local1: 1507741283326 server:1507741257818 local2: 1507741283440 diff1:-25508 diff2:25622
See here: https://github.com/sammchardy/python-binance#user-content-faq
Based on the diff, your local host time is off by more than half a minute. Try using an NTP server, transactions need to be within 1000ms to work.
Yes. You are right. I have used NTP server to sync the clock. If any body face this issue, please install ntp utility and add ntp.binance.com in the ntp configuration to sync the clock.
Thanks
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."