ACF datepicker meta_query Compare Dates in m/d/Y g:i a – Not in Ymd Format

There should not be any need to do this.

Even if an ACF Field is using 'return_format' => 'm/d/Y g:i a',

The post_meta value is in YYYY-MM-DD 00:00:00 format.

$date_now = date('Y-m-d');
$args = [
  'meta_key'=>'the_date',
  'meta_value'=>$date_now.' 00:00:00',
  'meta_compare'=>'>=',
];
$query = new WP_Query( $args );

Edit: I’ve noticed some discrepancies in this, the value may be in Ymd. When in doubt, check the data. You can find the post_meta by looking up the post_id in the wp_postmeta table.

Leave a Comment