Documentation

DateTime Field for Gravity Forms

The GravityWP DateTime Field add-on adds a dedicated Date/Time field to Gravity Forms. It allows users to enter both a date and a time in one field instead of using separate inputs.

This is useful for forms where the exact date and time matter, such as appointments, bookings, scheduling forms, event forms, and deadline-based workflows.

The field also includes Not before and Not after settings, so you can control the earliest and latest allowed value. These settings support merge tags, which makes it possible to create dynamic date and time rules based on other fields in the same form.

DateTime Field for Gravity Forms showing a field with the date and time picker open on the front end
The DateTime Field lets users choose both the date and time in one Gravity Forms field.

The DateTime Field gives you one field for collecting:

  • a date
  • a time

Instead of asking users to complete separate date and time inputs, you can collect one combined value in a simpler format.

Submitted values use this format:

YYYY-MM-DD HH:MM:SS

Example:

2026-04-10 10:00:00

DateTime Field for Gravity forms limits

The field includes a Date/Time Limits section in its field settings.

You can use:

SettingWhat it does
Not beforeSets the earliest allowed date and time
Not afterSets the latest allowed date and time

These settings are useful when a form should only accept values inside a specific date and time window.

Examples:

Use caseExample
Booking windowOnly allow bookings from 9:00 AM onward
Deadline controlStop users from choosing a date after a deadline
Start/end schedulingMake sure an end date and time cannot be earlier than a start date and time
DateTime Field settings in Gravity Forms showing Not before and Not after date and time limits
Use Not before and Not after to control the earliest and latest allowed date and time values.

Using DateTime Field fixed limits

You can enter a fixed value directly into Not before or Not after.

Example:

Setting / ValueResult
Not before2026-04-08 09:00:00
Not after2026-04-09 17:00:00
2026-04-08 08:00:00Rejected
2026-04-09 18:00:00Rejected
Value inside the rangeAccepted

When a submitted value is outside the allowed range, the field shows a clear validation message.

Example messages:

ConditionValidation message
Value is earlier than Not beforePlease enter a date/time on or after 2026-04-08 09:00:00.
Value is later than Not afterPlease enter a date/time on or before 2026-04-09 17:00:00.

Using merge tags in limits

The Not before and Not after settings support merge tags.

This makes it possible to create dynamic rules based on another field in the same form.

A common example is a form with:

  • Start Date and Time
  • End Date and Time

In this setup, you can set the End Date and Time field’s Not before value to the merge tag for Start Date and Time.

That means the form will only accept an end value that is equal to or later than the selected start value.

Example

Field setupValue
Field 1Start Date and Time
Field 2End Date and Time
End field settingNot before = merge tag for Start Date and Time
Start valueEnd valueResult
2026-04-10 10:00:002026-04-10 09:00:00Rejected
2026-04-10 10:00:002026-04-10 11:00:00Accepted
Gravity Forms DateTime Field validation error when the End Date and Time is earlier than the Start Date and Time
An Entry showing a validation error when the end date and time is earlier than the start date and time

DateTime Field for Gravity Forms – Validation behavior

The DateTime Field validates submitted values against the configured limits.

Values outside the allowed range are blocked during submission, and the form shows a clear validation error under the field.

This applies to both:

Validation applies toSupported
Fixed limitsYes
Merge-tag-based limitsYes

That makes the field useful for workflows where the order of date and time values matters.

When to use this field

The DateTime Field is a good fit when your form needs one combined date and time value.

Common use cases include:

Common use caseWhy it fits
Appointment requestsCollect one combined date and time value
Booking formsRestrict allowed date/time ranges
Event schedulingKeep scheduling inputs consistent
Registration windowsLimit submissions to an allowed period
Start and end schedulingPrevent the end value from being earlier than the start
Deadline-based formsBlock values after a cut-off date and time

Notes

  • The field uses one combined date and time input.
  • The limit settings support both fixed values and merge tags.
  • Submitted values use the format YYYY-MM-DD HH:MM:SS.

DateTime Field for Gravity Forms – FAQ

Can I use this field for booking forms?

Yes. The field is useful for booking and scheduling forms because it collects both date and time in one input and supports allowed date and time ranges.

What is the difference between Not before and Not after?

Not before sets the earliest allowed value.
Not after sets the latest allowed value.

Can I use another field as the minimum allowed value?

Yes. You can use a merge tag from another field to define the minimum allowed value for a DateTime field.

What happens if the submitted value is outside the allowed range?

The form shows a validation error and blocks submission until the value matches the configured range.

What format does the submitted value use?

Submitted values use this format:
YYYY-MM-DD HH:MM:SS

DateTime Field for Gravity forms limits Using DateTime Field fixed limits Using merge tags in limits DateTime Field for Gravity Forms - Validation behavior When to use this field Notes DateTime Field for Gravity Forms - FAQ Not before
Proudly powered by WordPress