Home › Forums › General Issues › Display upcoming events up to current hour › Reply To: Display upcoming events up to current hour
Hi @svsdnb
I believe Date/Time Picker add-on uses a timestamp to save the date in the database. If you use it, I believe you can do it like this:
$today_timestamp = time();
...
'meta_query' => array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'event_start_time',
'compare' => '>=',
'value' => $today_timestamp,
),
If you use ACF’s new date time picker field, I believe you can do it like this:
$today_datetime = date('Y-m-d H:i:s');
...
'meta_query' => array(
'relation' => 'AND',
'date_clause' => array(
'key' => 'event_date_begins',
'compare' => '>=',
'value' => $today_datetime,
'type' => 'DATETIME',
),
I hope this helps 🙂
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.