Do not display 2 last hours in get_historical_klines() (python-binance package)

My code is the following:

def get_history(symbol,interval,start,end=None):
    bars = client.get_historical_klines(symbol = symbol, interval= interval, 
                                        start_str= start, end_str= end, limit=1000)
    df = pd.DataFrame(bars)
    df.columns = ["Open time", "Open", "High", "Low", "Close", "Volume", "Close time", "Quote asset volume", 
               "Number of trades", "Taker buy base asset volume", "Taker buy quote asset volume", "Ignore"]
    df["Date"] = pd.to_datetime(df["Open time"],unit = "ms")
    df = df[["Open", "High", "Low", "Close", "Volume", "Date"]].copy()
    df.set_index("Date", inplace = True)
    for column in df.columns:
        df[column] = pd.to_numeric(df[column],errors="coerce")
    
    return df

When I call the function for the latest interval of 2 hours I introduce this for the couple “BTCUSDT”:

now = datetime.now()
two_hours_ago = now - timedelta(hours=2)
get_history(symbol="BTCUSDT", interval="1m", start = str(two_hours_ago))

But when it is displayed the DataFrame it only appears with data from two hours ago.

Example: If I execute the block of code with two_hours_ago at 18:30 and then, the function get_history at 18:31, it returns only the values from 16:30 to 16:31, while it should have returned from 16:30 to 18:31.

Is like the most two recent hours are not allowed for access, why is this happening?

Hey,
Have you tried to convert the start_str to a millisecond timestamp?
You can try the following:
int(datetime.timestamp(start) * 1000)

Already solved! I needed to change the system time to the UTC in order to work so in my country it was advanced two hours, that´s why I perceived a delay.

SOLVED. In case someone tries to use the same package, you just need to change the computer´s clock to UTC Time rather than your local time.

There should be a way to connect through the API in the local time but I think it would cause more problems rather than being a good solution, due to hourly changes of sun in winter and summer.