As per title – what format does the TIME type in a meta_query require?
I have a couple of custom fields, date
and time
– the aim is to show posts dated
today and in the future up to the hour before time
.
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'date',
'value' => date('Y-m-d',strtotime("today")),
'compare' => '>=',
'type' => 'DATE'
),
array(
'key' => 'time',
'value' => date('H:i', strtotime("now -1 hour")),
'compare' => '<=',
'type' => 'TIME'
)
)
The date
part of the query functions fine, but the time
query doesn’t – I suspect something to do with the format.