[![enter image description here](https://i.stack.imgur.com/nc0qz.png)](https://i.stack.imgur.com/nc0qz.png)

I have a form that shows different time spots (08:30-09:00, 10:00-10:30, 11:30-12:00).
It takes these spots from a list.

The problem is that (sometimes) it shows the spots of the next day.

In the list, I don't have spots for the date 18.10.2020. But it shows the spots of the next day (19.10.2020).

This is what the console shows:

[![enter image description here](https://i.stack.imgur.com/qFVPt.png)](https://i.stack.imgur.com/qFVPt.png)

The ID 9370 is the following one:

[![enter image description here](https://i.stack.imgur.com/UQ5SX.png)](https://i.stack.imgur.com/UQ5SX.png)

As you can see, the date is 19.10.2020.

I think that the issue must be in the following JavaScript code:

```
function loadSpots(dateString,divPicker) {

    var curvalue = NWF$("#" + varLocation).find("input:checked").val();

    if (curvalue == "Ulm") {
        var query = "$filter=(Date le datetime'"+dateString+"T23:59:00Z') and (Date ge datetime'"+dateString+"T00:00:00Z') and (Standort ne 'Taufkirchen') and (Standort ne 'Friedrichshafen') &$orderby=Spot asc";
    } else if (curvalue == "Taufkirchen") {
        var query = "$filter=(Date le datetime'"+dateString+"T23:59:00Z') and (Date ge datetime'"+dateString+"T00:00:00Z') and (Standort eq 'Taufkirchen')&$orderby=Spot asc";
    } else if (curvalue == "Friedrichshafen"){
        var query = "$filter=(Date le datetime'"+dateString+"T23:59:00Z') and (Date ge datetime'"+dateString+"T00:00:00Z') and (Standort eq 'Friedrichshafen')&$orderby=Spot asc";
    } else {}

    NWF$.ajax({
        url: "/tools/_api/web/lists/getbytitle('Win10RolloutSpots')/Items?" + query,
        contentType: "application/json;odata=verbose",
        headers: requestHeaders,

        error: function (xhr, ajaxOptions, thrownError) {
            alert("error:" + thrownError + "\n" + xhr.status);
        },

        success: function (data) {
            console.log("dateString: " + dateString);
            console.log("Spot data: ",data);
            var outhtml = "<table><tr>";
            var n = 0;
            for (var i = 0; i < data.d.results.length; i++) {
                n = n+1;
                outhtml += "<td>" + getButton(data.d.results[i]) + "</td>";

                if( n>=8) {
                    outhtml += "</tr><tr>";
                    n = 0;
                }
            }
            outhtml += "</tr></table>";

            NWF$("#"+divPicker).html(outhtml);
        }
    });

}

```

I'm not really that good with datetimes and query parameters.
Can someone have a look if there's something that sticks out that could be the issue?