Create Variable with timestamp as value to use with timepicker Button Panel

I want to create a dashboard variable to store the timestamp of a query to use in timepicker button panel.

I already have a dashboard variable for the Values stored in a measurement.
from(bucket: “Homebase”)
|> range(start: 0, stop: now())
|> filter(fn: (r) => r[“_measurement”] == “wthermostat.TEMP”)
|> filter(fn: (r) => r[“_field”] == “value”)
|> filter(fn: (r) => r._value == ${search_value})
|> last()

But the time that is shown in the TimePicker Buttons Panel is not the one the measurement was stored in Influx.

Can sombody tell me what i did wrong?