How can I convert UNIX timestamp into UTC timestamp and export data with UTC timestamp to csv in python? Here is my code:
from csv import DictWriter
orders = client.get_my_sales(symbol='AI95')
with open ('testcsv.csv', 'w') as outfile:
writer = DictWriter (outfile, ('time', 'symbol','orderId','price','qty'))
writer.writeheader()
writer.writerows (orders)
And this is the output of print(client.get_my_sales(symbol='AI95'))
[{'orderId': 22153, 'price': '500.30000000', 'qty': '8.05000000','qty': '1910.26500000', 'symbol': 'AI95', 'time': 1657118024716},
{'orderId': 22153, 'price': '600.30000000', 'qty': '10.05000000', 'qty': '2040.26500000', 'symbol': 'AI95', 'time': 1657118030000}]