Historical API is not sending Hours: Minutes: Seconds in date of script

Veera_Gaddam
Veera_Gaddam edited January 2023 in Python client
Hi Team,

I yesterday subscribed Kite API and historical API . While testing my Python code historical data is not providing time in date of script, it is Sending as 00:00:00+5:30GMT format.

Please help out why time coming as 00:00:00 some times ?
  • rakeshr
    Yes, for day candle interval time will come as 00:00:00+05:30 for hours and minutes stamp. Complete date field will be eg:2022-11-22 00:00:00+05:30
    For minute candle intervals, you will get values for hours and minutes. eg:2022-11-22 09:15:00+05:30
  • Veera_Gaddam
    Hi Rakesh,

    wrong data coming during from the Historical data date time stamp live,
    currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S
    currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S
    currentTime : 2023-01-12 00:00:00+05:30 -- not showing H:M:S
    currentTime : 2023-01-12 10:00:00+05:30 -- this is some correct data,,
    currentTime : 2023-01-12 00:00:00+05:30 -- wrong time showing
    currentTime : 2023-01-12 00:00:00+05:30 -- wrong time showing
    currentTime : 2023-01-12 10:03:00+05:30 -- this is some correct data,,

    Please help me out
  • rakeshr
    Can you paste here the complete request params?
  • Veera_Gaddam
    Veera_Gaddam edited January 2023
    def getHistoricalData(self, script, timeFrame):
    data = None
    try:
    data = self.util.kite.historical_data(script.scriptID, self.startDate, self.endDate, timeFrame, oi=True)
    return data


    ====================================================================================
    data = self.getHistoricalData(script, timeFrame)
    if data is None:
    self.error = ErrorMessage("{} History data selection issues".format(script.scriptName),
    errCode=603, errType='KITE_ERROR',
    errDesc="{} History data selection had issues-----, Please
    debug".format(script.scriptName))
    return self.error

    ==================================================================================
    # here my logic
    data_length = len(data)
    data_length = data_length - 1
    currentTime = data.date[data_length]
    lastFrame = currentTime.strftime('%H:%M')
    print('currentTime : '+str(currentTime)) ---> here I am printing the date , see the below H:M:S are 00:00:00 coming

    Output : See the below wrong time stamp in time data
    currentTime : 2023-01-12 12:42:00+05:30
    currentTime : 2023-01-12 00:00:00+05:30
    currentTime : 2023-01-12 00:00:00+05:30
    currentTime : 2023-01-12 00:00:00+05:30
    currentTime : 2023-01-12 12:42:00+05:30
  • Veera_Gaddam
    Hi Rakesh,

    I got the point by debugging, I am fetching Historical data for Index with Day timeframe.
    So Day time frame cant be send time stamp.

    After debugging so much I come know.. o:)

    Thanks,
    Veera
This discussion has been closed.