Hey Jonathan,
You brought me on the right track. I’m using WP_Query now, and I tried with ‘hh-ii-ss’ format first as you suggested.
It was still not working, so I went looking in the db myself and saw it was stored as ‘hh:ii:ss’ in my case….
So this is working now:
$sluitingsdagen = new WP_Query(
array(
'numberposts' => -1,
'post_type' => 'her_sluitingsdagen',
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'hele_dag',
'value' => 'Nee',
'compare' => '=',
),
array(
'key' => 'beginuur',
'value' => date('H:i:s',$datum),,
'compare' => '<=',
),
array(
'key' => 'einduur',
'value' => date('H:i:s',$datum),,
'compare' => '>=',
),
),
));
Thanks!