question about ib_insync API-time zone issue

Discussion in 'Interactive Brokers' started by orangelam, Feb 5, 2019.

  1. i found that when i use python API ib_insync to look at the fill report, the filled time is UK time. However, the setting in my TWS is my local time and the filled time in "Trades" in TWS is also local time. so i think it is the API problem. does anyone know how to ask API to follow TWS's time zone?
     
  2. Unfortunately, Python's timezone support is kinda garbage so libraries do half-assed jobs with it. What you probably want to do is take the time, futz around with it using pytz to get it into the timezone you want.
     
  3. yes, actually i know the time difference so i can manually convert it. my concern is if i don't know how the API define the time zone, i m afraid in one day it will change to another one so it will affect my converted time to place the orders

    so the time of this ib_insync API package is fixed at UK time? if there is a global setting to define the time zone, it would be great and save.

    if cannot have the global setting, i think what making sense is using a function to find the timezone defined by the API and then based on this timezone i can convert to my local time, so even if one day the timezone changed by the API, i can know how to convert to my local time.

    i only got the plain text of time from fill report. how can i know the timezone defined for each single order?