Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Conditions: Date & Time. UTC confusion?

  • When I use the Date & Time condition and select my current date and time, it doesn’t produce the expected result because the date and time picker shows my actual date and time. However, in my testing, the rule seems to trigger based on UTC.

    Is that correct?

    For example, if I select Date & Time, then choose Before, and use the date and time picker to select today’s date, and nudge the time forward by five minutes, you would expect the overlay to display for the next five minutes. However, the actual result is that it doesn’t display at all.

    I couldn’t figure this out for a long time until I tried setting the date and time to a time 7 hours and 5 minutes into the future, and then the overlay displayed for the next five minutes. Indeed, I’m in UTC-7 time zone where I live.

    If this is true and deliberate, I think that’s very confusing. Many people will want to ditch the Block Visibility plugin to use GP’s conditions, but the Block Visibility plugin allows you to just use your local time from the WordPress settings. In that plugin, if I set something to be displayed until 5PM, it will be displayed until 5PM in my timezone. That’s easy to manage. Currently, with GP conditions, I would have to recalculate everything into UTC continuously. And then what happens on the day of the week condition? So if I want to show something only on a Saturday, it would actually start showing up on my site 7 hours before Saturday starts in my time zone?

    I’m also somewhat confused about the Rules.

    Current Date – If you select this one, the UI still asks you to “Select date and time”

    So, is it just ignoring the time after you have selected it? Only the date is relevant? And the date is based on UTC date? So, a condition will be met at midnight UTC, no matter what time is selected in the date and time picker?

    Current Time – If you select this one, again the UI asks you to select a date and a time. In this scenario, are both the date and the time relevant to the rule? Or in this case, does it just look at the time?

    Time of Day – What is the difference between this one and Current Time? The support doc says this is for “Hourly Scheduling”, but again, the UI asks for a time and a date, so I really have no clue what this should be used for.

    UPDATE

    After further testing, I really can’t see the difference between Current Date and Current Time, either. Both of them actually seem to take into account both the date and the time. I can use them completely interchangeably to get the same results, as long as I do the correct time zone recalculation to use UTC time. There must be an intended difference between how they work. Can you please explain?

    Thanks

  • Hi there,

    We can confirm this is a bug — the time settings should respect the site’s configured timezone, and a fix is already in the works.

    As for Current Date vs Current Time — at the moment they behave the same, but the intended behavior is that Current Date should only display a date picker, while Current Time should only display a time picker. This will be corrected as well.

  • Thanks for letting me know. Geez, I wasted so much time (hours!) experimenting with all of this, trying to figure out what the heck was going on. It’s a bummer this made it through the alpha and beta releases.

  • Thanks for your patience, and apologies for the inconvenience. The fixes are already in place. If you’d like to try them out, GB Pro 2.4 Beta-1 includes these changes and can be safely tested on a staging site.

  • Thanks. I’ll give that a go.

  • Ok yeah Beta 1 seems to solve these issues.

    One question. When you set Before > Current Time > 9am

    Would this display between midnight and 9am?

  • The “Current Time” and “Time of Day” are functionally identical. We will likely remove one, as having both is pointless. They both allow you to choose a time (before, after, on, between, etc…)

  • Yes, but how are you defining “before” when it comes to time?

    My question still stands. When you set Before > Current Time (or Time of Day) > 9am

    Would this display between midnight and 9am?

  • Yes, I think so.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.