How to Setup Time-based Conditional Logic for Gravity Forms the Easy Way

A point-and-click solution for creating conditional logic rules based on the current time. Works anywhere Gravity Forms conditional logic is supported (i.e. fields, confirmations, notifications, etc).

This article requires the Gravity Forms Conditional Logic Dates perk.

Buy Gravity Perks to get this perk plus 46 other premium Gravity Forms plugins!

View Plugin Buy Gravity Perks

This tutorial will demonstrate how to show/hide fields via Gravity Forms’ conditional logic based on the current time. This functionality can be used anywhere conditional logic is available and is made available by the GP Conditional Logic Dates plugin.

Here are just a few examples of how this could be useful:

  1. Time-sensitive Submissions
    Allow a Gravity Form to only be submitted during a certain time of day.
  2. Time-dependent Confirmations & Notifications
    Display different confirmation messages or send specific notifications depending on the time of day the form is submitted.
  3. Time-responsive Fields
    Show or hide fields on your form depending on the time of day.

Ready to get started? Here we go!

Steps

  1. Install & activate GP Conditional Logic Dates.
  2. Add a time-based conditional logic rule.

1. Install & activate GP Conditional Logic Dates.

Install and activate GP Conditional Logic Dates.

2. Add a time-based conditional logic rule.

  1. Open your form in the Form Editor.
  2. Select the field for which you want to configure a time-based conditional logic rule.
  3. Click the “Advanced” tab.
  4. Click the “Enable Conditional Logic” setting.
  5. Select “Δ Current Time” from the first drop down which contains your form fields.
  6. Enter the time in the required format.

Time-based conditional logic must be entered in the 12-hour format.

That’s it! Your field will now show or hide depending on the specified time-based rule.

time-basted-conditional-logic-morning-optionsDisplay Morning Options before 12pm
time-basted-conditional-logic-afternoon-optionsDisplay Morning Options after 12pm

Comments

  1. Mike
    Mike June 2, 2022 at 6:46 pm

    Hi Guys,

    Unable to make this feature works: {today:-90 days}

    I would like a field shown only if the date put by the user is no more than 90 days before the today date.

    If I set the conditional logic like this: show if all date, is, {today:-90 days}

    It’s just never showing the field. With an only few days before today but same with 91 days before…

    Any idea? Do i’m doing something wrong ?

    Thanks and best regards, Mike

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff June 3, 2022 at 6:21 am

      Hi Mike,

      Instead of using the “is” operator, can you try using Greater Than? So you should have something like Today’s date greater than {today:-90 days}.

      I hope this helps.

      Best,

  2. Scott-Leonard Landers
    Scott-Leonard Landers May 26, 2022 at 10:02 pm

    With the UTC timezone snippet mentioned in an earlier comment here, is there any way to specify another timezone? eg. UTC+8 ?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff May 27, 2022 at 7:25 am

      Hi Scott,

      By default, the Conditional logic will use the time zone set for the Website on the Setting pages, so if you want to use a different TimeZone, you can set it there. However, if you want to adjust the Timezone to UTC +8 regardless of the default timezone set, that snippet will have to be customized further. If you have an active Gravity Perks Pro License you can get in touch with us via our support form, so we can assist you further.

      Best,

  3. Ellen
    Ellen February 8, 2022 at 2:56 pm

    Does this conditional logic work as a before this date? For instance, the form cannot be submitted if the date picker date selected is on or before 1/1/2015?

    Reply
    1. Dario Space
      Dario Space February 8, 2022 at 2:58 pm

      Hi Ellen,

      Yes, you should be able to show/hide the Submit button of the form based on a date on the form using Conditional Logic Dates Perk/

      Cheers,

    2. Ellen
      Ellen February 8, 2022 at 3:03 pm

      Thanks for the quick response. Does it also work with a “Today less 4 years” scenario? We need to have the form require the date be less than 4 years ago.

  4. Cel
    Cel December 1, 2020 at 7:18 am

    We want to set up a simple responder dependant on the “local” time of day, ie. 5:00pm GMT, but our visitors may be in different time zones. Is the time set by the client side or the server? is there a way to set the time to particular timezone?

    Reply
    1. Samuel Bassah
      Samuel Bassah Staff December 1, 2020 at 9:35 am

      Hi Cel,

      GP Conditional Logic Dates uses the user’s local time based on their user profile, but if you’d prefer to set it based on UTC, we have a snippet for that. It automatically adjusts the user’s local time to UTC and then evaluates based on that.

      I hope this helps.

      Best,

  5. Bill Deputy
    Bill Deputy August 10, 2020 at 9:22 am

    I need to have users fill out a form stating someone’s birthday. 

If the birthday is too soon, I do not want them to be able to complete the form.



    I need to edit videos and a minimum of 4 days is required. They need to INVITE friends/family to upload videos which also requires at least 3 days. SO……. 



    When they answer the question of WHAT DATE the recipient’s BIRTHDAY is, I want to have the form automatically process the VIDEO UPLOAD DATE = (which is 4 days BEFORE the birthday) –

    and also have a date displayed for the minimum 3 days to INVITE friends/family to UPLOAD videos.

Can I do this with the Gravity Forms Conditional Logic Dates Add-on???

    Reply
  6. Perry
    Perry August 4, 2020 at 11:03 am

    Hello, We are caterers who offer ordering up until Thursday at 5pm for pickup on Sunday. We want to limit the available pickup dates based on that Thursday at 5pm cut off. Meaning, today is Tuesday, 8/4/2020. People can order food this week until Thursday, 8/4/2020 until 5pm for pick up on Sunday, 8/9/2020. We want to offer pickup times of Sunday in the future but no longer offer 8/9/2020 as a pick up time after Thursday at 5pm. Is that possible? (Did I ask the question so it makes sense?) Thank you! – Perry SIOD

    Reply
  7. Lena
    Lena November 21, 2017 at 3:29 pm

    Can this be used to send the form to different people based on time of day? For instance? – Between 9-5 form is emailed to Bob. – After 5 and before 9, email is sent to Sally.

    Would this work?

    Reply
    1. David Smith
      David Smith Staff September 18, 2017 at 9:58 pm

      Our best solution is the GP Date Time Calculator plugin that is available as an early access perk with our Gravity Perks plugin suite. It provides an “:age” merge tag so you can just put it in your formula like so: {Date of Birth:2:age}. If you’d like to try it out pick up a copy of Gravity Perks and drop us a line via support.

  8. Michael
    Michael January 19, 2017 at 2:11 pm

    Essentially trying to get a field to display on a weekday BEFORE and AFTER business hours and not during normal business hours. I’ve successfully gotten my {monday}-{friday} types of tags working from your conditional date plugin. I’m just running into a roadblock trying to get this logic to work out someway.

    Here’s What I have for the field I’m trying to hide or display:

    [Show] this field if [All] of the following match: Current Time is [Less Than] 07:00am Current Time is [Greater Than] 04:00pm Today [isnot] {Saturday} Today [isnot] {Saturday}

    Any help on how to get this done would be much appreciated!

    Reply
    1. baljeet
      baljeet August 15, 2017 at 12:16 am

      I am using “Beta version” of GP Conditional Logic Dates but i did not get “current time” option in that. Also its not working with week names like i want to open my salon from Monday to Friday so don’t want to book any entry for Saturday and Sunday

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.

Grab a bundle of free Gravity Forms plugins

Enter your email and receive our most popular free plugins and snippets, plus access to hundreds of others.

This field is for validation purposes and should be left unchanged.