Lu-Yi-Hsun / iqoptionapi

IQ Option API
374 stars 289 forks source link

how to use Iq.get_server_timestamp() ? #295

Open Janeyz opened 3 years ago

Janeyz commented 3 years ago

how i convert time 1613136103.658 from Iq.get_server_timestamp() to normal time please?

lp1982 commented 3 years ago

Python's datetime module is your friend.

https://www.epochconverter.com/

suphachok commented 3 years ago

from datetime import datetime while True: last_time = Iq.get_server_timestamp() check_time = datetime.fromtimestamp(last_time).strftime(" [%H:%M:%S]") #convert this print('Time = ',check_time) print('ผมกินน้ำมะพร้าวบ่อยมาก') time.sleep(1)