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

9th November 2023

MasterPress 1.3.10 is a feature and bugfix release. Workaround for fatal error introduced by changes to WordPress’ wpdb class in WordPress 6.4. Added actions to MPC files upload_field & WF image save_image functions.

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