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.4.1 is now available

27th May 2024

This update addresses backwards compatibility issues that were introduced in the previous update. There were some edge cases where PHP 7 had issues and it didn’t work at all on PHP 5.6. We have now changed it so that the PHP 8 compatibility changes will now only affect PHP 8 and will be more thorough… 

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