Closed IanFLee closed 3 years ago
Are you dividing by 1000? You shouldn't
No, I'm not dividing by 1000. My code looks like this:
for kline in klines:
date = kline[0]
int_date = int(date)
y = datetime.datetime.fromtimestamp(int_date)
z = y.isoformat()
candle = { 'datetime':z, 'open':float(kline[1]), 'high':float(kline[3]), 'low':float(kline[4]),
'close':float(kline[2]), 'volume':float(kline[6]) }
What does y show if you print it out? That's exactly how I do it to get to a python datetime type, and it's exactly as it should be. Is something going wrong with z?
I'm not sure what the issue is here. My code block didn't change but now I'm getting correct values. Closing this issue.
klines = client.get_kline_data(self.coin, kline_type=self.interval, start=1613096100)
this should return data starting feb 11 of 2021, but i'm always getting unix 0 dates (jan 19, 1970)
is anyone else having this problem or understand why i'm getting this issue?
also, the python-binance wrapper converts timestamps from strings like "1 week ago UTC" and I love it. it would be great if we could get that functionality here as well.