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
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?


June 12, 2015 at 1:32 pm #3665
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
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.0 is now available

6th May 2024

This release has a focus on improving compatibility with PHP 8.2. The introduction of inheritance validation to PHP produced a lot of warnings when using MasterPress with PHP 8.2. I have updated most of the problematic code – but some code would have broken in previous PHP versions, so I have temporarily disabled inheritance validation… 

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 hosted service.

Three AM