[Resolved] View with date filter

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 3 replies, has 2 voices.

Last updated by Adriano 5 years, 5 months ago.

Assigned support staff: Adriano.

Author
Posts
#247887

Hi,

I have created a view with a filter by date
wpcf-fecha-y-hora BETWEEN TODAY(), FUTURE_DAY(1)

it must display the events I've defined that happens today with the types field "fecha-y-hora". It works perfect except for a detail, It doesn't respect the UTC I have defined in the WordPress general settings: UTC-4 hours and at 8pm it understand that we are in the next day.

How can I correct it?

Thanks in advance

#248472

Adriano
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

That's a expected behaviour, because our functions uses system's date by adodb_date(). So there is no way to use the UTC defined in WordPress settings for now.

#249927

Finally I solved it. I added in functions.php this code:

date_default_timezone_set(get_option('timezone_string'));
#250047

Adriano
Supporter

Languages: English (English )

Timezone: America/Sao_Paulo (GMT-03:00)

Nice! Thank you for sharing the solution with us.