Date Format UTC

Hi ,
i am using WooEvents to display Events on WC. So far so good.

Now i want to display the WC-Products with a looper, but the date format is wrong,
It shows the UTC:
1748654100 – 1748691000
when I use {{dc:post:meta key=“we_startdate”}} – {{dc:post:meta key=“we_enddate”}}

with
{{dc:post:meta key=“we_startdate” type=“date” format=“d. M Y”}} – {{dc:post:meta key=“we_enddate”}}
it shows the globe date, today…?

How can is realize this?

Thanks and
kind regards,
Christian

Hi Christian,

Thanks for reaching out.
If the values is correctly added into the the meta field, the {{dc:post:meta key=“we_startdate” type=“date” format=“d. M Y”}} should work. To check that, please provide login credentials for your site in a secure note to examine it further, including:

– WordPress Site URL & Login URL
– WordPress Admin username/password
– Specific page or layout where you have used it.

To create a secure note, click the key icon underneath any of your posts.

Thanks

Hi Tristup,
thanks for writing back so fast :wink:
I provided the login credentials for you to take a closer look…thanks!

kind regards,
christian

Hi Christian,

Unfortunately, the given credentials are not working. Can you please check and send it once again ?

Thanks

…its working now…forgot to save :wink:

Hello @cyrock,

I would suggest you please add this code to convert the post meta value to a date format.

{{ {{dc:post:meta key="we_startdate"}}  | date('j. m. Y') }}
-
{{ {{dc:post:meta key="we_enddate"}}  | date('j. m. Y') }}

OR

{{ post.meta({ "key": "we_startdate"})|date('j. m. Y') }}
-

{{ post.meta({ "key": "we_enddate"})|date('j. m. Y') }}

Please feel free to change the date format to match your design.

Hope it helps
Thanks

Dear Prakash,
thanks for helping me out so good. This is another key or cornerstone to work independently and good with the meta datas!

THANKS!!!

Kind regards,
Christian

Hi Christian,

Glad that we are able to help you.

Thanks

Hi, I am still working on this. To display future events, I use the following query:

The Looper Provider Query String is post_type=products&meta_query%5B0%5D%5Bkey%5D=we_startdate&meta_query%5B0%5D%5Bvalue%5D={{dc:global:date format="Y-m-d"}}&meta_query%5B0%5D%5Bcompare%5D=%3E&meta_query%5B0%5D%5Btype%5D=DATE :

post_type = products
meta_key = we_startdate
meta_ value = {{dc:global:date format=“Y-m-d”}}
meta_ compare = >
type = DATE

Its not working and i am going crazy, cause I can’t find the mistake…

kind regards,
Christian

Thank you for the update. We replaced the value of the Meta Value field with {{ date.generic({“date”:“now”}) }}. Please check the screenshot below.

This compares the value of we_startdate with the current date. If we_startdate is later than the current date, the item or post will be displayed.

Let us know if you need more info.

Best regards,

Dear Ismael,
thanks for your friendly help :slight_smile:

best regards
christian

Hi Christian,

Glad that we are able to help you.

Thanks

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.