I have a custom field that has a date picker. This date is in the format 11/12/2019. In my query I have the following:
$meta_query = array(
array(
'key' => 'date-available',
'value' => date("m/d/Y"),
'compare' => '<',
),
);
This works in that it shows the posts where the custom date is less than the current date for this year and the December dates for this year don't show. But, for some reason the posts that have a date for 01/07/2020 still show. Anyone have an idea as to why?
<
or>
don't work with your date format. in my past developments, I decided to store date as timestamp because I want to control what append. I don't know if it's a waste of resources but it give the expected results.