¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Code: 10314 - Start Date/Time: The date, time, or time-zone entered is invalid


 

I used the function ibClient.ClientSocket.reqHistoricalTicks(reqId, contract, "20230911 11:01:00 US/Eastern", "", 50, "Trades",
??????????? 0, false, null) to obtain the historical Time & Sales data of INDU (the Dow Jones 30 index) with following contract
settings:
??????????? contract.Symbol = "INDU";
??????????? contract.SecType = "IND";
??????????? contract.Exchange = "CME";
??????????? contract.Currency = "USD";
But I got the Error: "Code: -1 - Error: Start Date/Time: The date, time, or time-zone entered is invalid. The correct format is yyyymmdd hh:mm:ss xx/xxxx where yyyymmdd and xx/xxxx are optional. E.g.: 20031126 15:59:00 US/Eastern? Note that there is a space between the date and time, and between the time and time-zone.? If no date is specified, current date is assumed. If no time-zone is specified, local time-zone is assumed(deprecated).? You can also provide yyyymmddd-hh:mm:ss time is in UTC. Note that there is a dash between the date and time in UTC notation."

I don't understand this error because My Start Date/Time is "20230911 11:01:00 US/Eastern" which is the exact required format for the API.

What's wrong with my codes?

Thanks in advance.



?


 

¿ªÔÆÌåÓý

If you specify a timezone in a historical data request, it has to be either the timezone defined in the contract details, or your local timezone.

?

For INDU, the timezone is US/Central, not US/Eastern.

?

By the way, there are still some contracts that have ¡®old¡¯ timezone identifiers like EST. For these you have to use that value rather than the sensible version ¨C so not US/Eastern where the contract says EST. I believe IB are gradually updating the contract database to use the standard form consistently, but they¡¯re not there yet.

?

It would be sensible for IB to accept any valid timezone designator and convert the end time as appropriate, but the extra two lines of code required are presumably just too much for them¡­

?


 

On Sun, Sep 17, 2023 at 04:19 AM, Richard L King wrote:
Central

Thank you very much for your help.
I changed the Start Date/Time from "US/Eastern" to "US/Central" in my function call. It works OK now.
Thanks a lot!