# Loop with meta Query set on Toolset Date Time field

**URL:** <https://forum.bricksbuilder.io/t/loop-with-meta-query-set-on-toolset-date-time-field/21231>\
**Category:** Uncategorized\
**Created:** [March 25, 2024, 11:56am UTC](https://forum.bricksbuilder.io/t/loop-with-meta-query-set-on-toolset-date-time-field/21231 "2024-03-25T11:56:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SVIreland](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/svireland/32/17603_2.png) [@SVIreland](https://forum.bricksbuilder.io/u/SVIreland)\
**Post date:** [March 25, 2024, 11:56am UTC](https://forum.bricksbuilder.io/t/loop-with-meta-query-set-on-toolset-date-time-field/21231/1 "2024-03-25T11:56:16Z")

</div>

I am trying to achieve the same result as outlined in the following post but using a date/time custom field that is generated in Toolset and returns a numeric value in seconds:

> [@SOLVED: Post Loop Meta Query by ACF Date Field](https://forum.bricksbuilder.io/t/solved-post-loop-meta-query-by-acf-date-field/2309/13):
>
> I’m interested in this too. Seeing if I can get this working from the Toolset DateTime custom field. I see that ACF is more compatible in areas like this. Would Metabox be similar?

I also have some feedback from Toolset support:

> **[Using META Query in Bricks to filter by date. - Toolset](https://toolset.com/forums/topic/using-meta-query-in-bricks-to-filter-by-date/)**
>
> I am experimenting with the linked site as a rebuild using Bricks. I have the option of using the original views or, implementing the loop natively in

A number of things:

• the field is pulled in in the following format {ts\_event-date-time} in the Bricks forum link I note that the result removed the {brackets} and the acc\_ prefix.  
• I see that ACF uses underscore while Toolset uses hypehns. Not sure if this makes a differnce.  
• I am a bit confused betweeen the Meta Key and Meta Value fields in the example. The custom field can be accesed from the Meta Value dropdown but in the example this is placed into the Meta key field while the cuttent of the Meta Value is {current\_date:Ymd}

From Toolset suport:

“If you are using something else to generate the query (in this case, Bricks), then the meta value you should be comparing against should be a timestamp (the PHP function time() would generate the current timestamp, for example).”

So I suppose I need some way to generate that timestamp and have it in the Mata Value field.

---

<div class="post-metadata">

**Author:** ![SVIreland](https://forum.bricksbuilder.io/user_avatar/forum.bricksbuilder.io/svireland/32/17603_2.png) [@SVIreland](https://forum.bricksbuilder.io/u/SVIreland)\
**Post date:** [March 28, 2024, 11:48am UTC](https://forum.bricksbuilder.io/t/loop-with-meta-query-set-on-toolset-date-time-field/21231/2 "2024-03-28T11:48:56Z")

</div>

SOLVED: The way to do this is as follows:

• Meta Key: wpcf-event-date-time. Make sure to prefix your field slug with wpcf- The dynamic data mechanism with often prefix Toolset with ts- Ignore this prefix for certain use cases.

• Met Value: {current\_date:U}. The uppercase matches UNIX epoch in seconds from the beginning of 1970. Toolset date/time fields are set in this format.

• For the type select NUMERIC.
