Historical candle data - Timezone Issue

Ronit
Ronit edited July 2021 in API clients
While making a request to - /instruments/historical/:instrument_token/:interval

Expected timestamp format - in Response
"2015-12-28T09:15:00+0530"

Actual timestamp format - in Response;
"2015-12-28T09:15:00"

Problem:
We are not receiving the TZ offset as per the documentation

Please check the `data[0]` argument in the attached images




  • Ronit
    The Problem could be better defined as that:
    We don't know what TZ the data is in and just want to know the same
  • rakeshr
    Which official kite connect lib client are you using?
    As raw historical data request fetches TZ info.
    [
    "2021-06-11T09:15:00+0530",
    1575,
    1610.5,
    1572,
    1608.75,
    2179
    ],
    [
    "2021-06-11T09:16:00+0530",
    1610,
    1615.1,
    1575,
    1610,
    3962
    ],
  • tonystark
    @Ronit The format you expect is what comes in the JSON response. Client library parses it into DateTime object that you can work with. What you are looking at is the normal ToString() version of the DateTime object. If you want the time zone info in it then you have to pass the format to ToString.
  • Ronit
    @tonystark thanks - ToString() with formatting worked

    .ToString("MM/dd/yyyy HH:mm:sszzz")


Sign In or Register to comment.