Date filters – past() – and timezones

This topic is: not resolved
Viewing 3 posts - 1 through 3 (of 3 total)
Author Posts
June 11, 2015 at 7:50 am #3664
TUC
Post count: 7

We are using the past() method to check if the end date of an event (MPFT_datepicker) has gone by.

We are in zone America/Vancouver – UTC-8 – and the function is returning true for anything up to 8 hours in the future.

How can we use this function and get the correct answer in our timezone?

thanks.

June 12, 2015 at 1:32 pm #3665
traversal
Post count: 207

Yes, interesting question, after looking into it, it seems the past and future methods might be a little simplistic, and need to consider the timezone offset as well. I’ll look into it further to work out what the correct code should be, and let you know when a fix is available.

January 22, 2016 at 9:43 am #3711
TUC
Post count: 7

Hi – just wondering if you’d had a chance to address this – we continue to workaround using WP_Query but proper treatment of timezones in past() and future() would help a lot. Thanks,

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

Latest From the Blog

MasterPress 1.3.6 is now available

Masterpress 1.3.6 is a compatibility release. It resolves an edge case with shared fieldsets not working for MySQL 8 when the fieldset is limited to more than 1 post type or taxonomy or excluding any post types or taxonomies.

Plugin Requirements

MasterPress requires a minimum of WordPress version 4.9, MySQL 5.6, and PHP version 5.6.20.

We also recommend that PHP is configured to use a memory limit of 64MB per request (128MB may be required for sites with higher complexity).

This plug-in is not compatible with the WordPress.com hosted service.

Three AM