Documentation

Relative Date Formats in Gravity Forms (gwp_date_format, gwp_date_created, gwp_date_updated)

The gwp_date_format, gwp_date_created, and gwp_date_updated merge tags all support relative date handling via the modify parameter. This lets you shift a date forward or backward (e.g., +1 week, -2 days) or use natural language like “next Monday” or “last day of this month.

Relative date formats follow PHP’s Supported Date and Time Formats (including Relative Formats), giving you flexible control over how dates are displayed. This is especially useful in Gravity Forms when you want to automatically calculate deadlines, reminders, or dynamic confirmation messages.

Syntax

When using relative formats, combine modify with format:

{Date Field:4:gwp_date_format modify="+1 week" format="Y-m-d"}  
  • modify → A relative date expression (e.g., +1 day, last friday).
  • format → The output format (standard PHP date tokens such as Y-m-d).
  • field_format (only needed for Text fields) → The original format of the stored date (e.g., Y-m-d).

Example with a Text field:

{Text Field:1:gwp_date_format field_format="Y-m-d" modify="-2 days" format="d/m/Y"}

Common Gravity Forms Relative Date Examples

Assume the base date/time is 2025-06-07 14:00 (June 7, 2025, at 2:00 PM).

Relative ExpressionExample SyntaxEffect (from 2025-06-07 14:00)
+1 day{Date Field:4:gwp_date_format modify="+1 day" format="Y-m-d"}Shifts date forward by 1 day → 2025-06-08
-2 weeks{Date Field:4:gwp_date_format modify="-2 weeks" format="Y-m-d"}Shifts date backward by 2 weeks → 2025-05-24
+1 month -3 days{Date Field:4:gwp_date_format modify="+1 month -3 days" format="Y-m-d"}Adds 1 month, subtracts 3 days → 2025-07-04
tomorrow{Date Field:4:gwp_date_format modify="tomorrow" format="l, F j, Y"}Displays next day → Sunday, June 8, 2025
next monday{Date Field:4:gwp_date_format modify="next monday" format="l, Y-m-d"}Finds next Monday → 2025-06-09
last friday{Date Field:4:gwp_date_format modify="last friday" format="Y-m-d"}Finds previous Friday → 2025-06-06
first day of next month{Date Field:4:gwp_date_format modify="first day of next month" format="Y-m-d"}Moves to first day of July → 2025-07-01
last day of this month{Date Field:4:gwp_date_format modify="last day of this month" format="Y-m-d"}Moves to last day of June → 2025-06-30
next monday 09:00{Date Field:4:gwp_date_format modify="next monday 09:00" format="Y-m-d H:i"}Next Monday at 9 AM → 2025-06-09 09:00
+2 weeks 18:30{Date Field:4:gwp_date_format modify="+2 weeks 18:30" format="Y-m-d H:i"}Two weeks later at 6:30 PM → 2025-06-21 18:30
now{Date Field:4:gwp_date_format modify="now" format="Y-m-d H:i"}Current date/time → 2025-06-07 14:00

These examples show typical Gravity Forms relative date patterns you can reuse in confirmations, notifications, or front-end displays.

For the full list of supported relative expressions, see the PHP Relative Formats documentation

Timezones

By default, gwp_date_format uses the WordPress site timezone.
You can override it with the timezone parameter:

{Date Field:4:gwp_date_format modify="+1 day" timezone="Europe/Amsterdam" format="Y-m-d H:i:s"}  

Valid values come from the PHP timezone list.

Edge Cases for Gravity Forms Relative Date Usage

  • Month overflow: Adding 1 month to January 31 may result in March 3, not February 28. This is standard PHP behavior.
  • Unspecified parts: If you only specify a month or weekday, PHP reuses the base date’s parts. For example, strtotime("February") on May 31 can roll forward into March. To avoid this, use first day of February.
  • Time combinations: Relative date strings can also include times (e.g., next friday 18:00).

Output Formatting

The format parameter uses standard PHP date tokens. Examples:

  • Y-m-d → 2025-06-07
  • d/m/Y → 07/06/2025
  • l, F j, Y → Saturday, June 7, 2025
  • Y-m-d H:i:s → 2025-06-07 14:00:00

See the PHP date format reference for the full token list.

Note

Relative date formats using modify behave consistently across gwp_date_format, gwp_date_created, and gwp_date_updated. The only difference is the base date:

  • gwp_date_format → uses the field’s submitted date (or text field with field_format).
  • gwp_date_created → uses the entry creation date/time.
  • gwp_date_updated → uses the last updated date/time for the entry.
Advanced Merge Tagsv1.9.3

To use the functionalities described in this documentation, you'll need to get the GravityWP - Advanced Merge Tags add-on.

Read more