Do you want to display or use a Gravity Forms Date Field value as another relative date, for example tomorrow or week later, the first day of next month or a certain amount of days ago? With the GravityWP – Advanced Merge Tags Add-on for Gravity Forms you get a Merge Tag Modifier to easily do that.
Modifier gwp_date_format
You can use the gwp_date_format Modifier to accomplish modifying the Merge Tag value (output) of a Date Field (and even a Text Field which contains a correctly formatted date). See for example the code below, where the Modifier takes the filled in value in the form and modifies the output to the first day of next month and shows the result in the format m/d/Y:
{Date Field:5:gwp_date_format modify="first day of next month" format="m/d/Y"}
Configuring relative date formats
Check out the documentation on Relative Formats on php.net. We’ll give you a brief ‘How To’ here.
To configure the relative date, you have to fill something after ‘modify=’ in the Merge Tag Modifier. You can make your own combination using the tools below:
| dayname | sunday | monday | tuesday | wednesday | thursday | friday | saturday | sun | mon | tue | wed | thu | fri | sat |
| ordinal | first | second | third | fourth | fifth | sixth | seventh | eighth | ninth | tenth | eleventh | twelfth | next | last | previous | this |
| unit | sec | second | min | minute | hour | day | fortnight | forthnight | month | year | weeks | daytext |
Make combinations
modify="+1 month" | Date + 1 month |
modify="last day of +1 month'" | Date + 1 month > last day of that month |
modify="+2 weeks" | Date + 2 weeks |
modify="-2 weeks" | Date minus (-) 2 weeks (two weeks ago) |
modify="2 weeks ago" | Date minus (-) 2 weeks (two weeks ago) |
modify="+3 weekdays" | Date + 3 weekdays (skips the weekend) |
Skip the weekend using weekdays
You can also use ‘weekday’ or ‘weekdays’ in the Merge Tag Modifier. In that case it will skip Saturday and Sunday (skip the weekend). For example if you use a date that is on Friday and you use in the Merge Tag Modifier ‘+1 weekday’, it will give you the date of Monday. If you use the same relative date on Monday, it will return Tuesday.
{Date Field:1:gwp_date_format modify="+1 weekday" format="m/d/Y"}
{Date Field:1:gwp_date_format modify="+3 weekdays" format="m/d/Y"}
Change the output date format
You can use the gwp_date_format Modifier in combination with other settings, like output format. We’ve included that in the examples before.
{Date Field:1:gwp_date_format modify="+3 weekdays" format="Y-m-d H:i:s"}
Change the timezone
You can also directly change the timezone of the output. Use it in combination with the timezone setting:
{Date Field:1:gwp_date_format modify="+3 weekdays" format="Y-m-d H:i:s" timezone="Europe/Amsterdam"}
Read more about changing timezones in our tutorial: Modifying Timezone Gravity Forms Date Field.
Date Created
You can also use the modify settings on the date the Gravity Forms entry was created. Use for that the gwp_date_created Merge Tag (no need to add an id, because this is meta data in the Entry):
{gwp_date_created modify="+3 weekdays" format="d-m-Y"}
Date Updated
You can also use the modify settings on the date the Gravity Forms entry was last updated. Use for that the gwp_date_updated Merge Tag (no need to add an id, because this is meta data in the Entry):
{gwp_date_updated modify="+3 weekdays" format="d-m-Y"}
FAQ relative dates
Does the gwp_date_format Merge Tag Modifier changes the value of the field in the Gravity Forms Entry?
Can I also change the Merge Tag ouput of the Date Created of the Gravity Forms Entry?
Can I change the Merge output of the date the Gravity Forms Entry was last updated?
Why do I have to fill in the Field ID in the gwp_date_field Merge Tag?
Can I use any relative date functionality to modify the Date?
Our Premium add-ons for Gravity Forms
List Number Format
With this Gravity Forms Add-on you can change List Field columns into a number field, do calculations within a row or column. Extra merge tags are available with total counts of columns.
Advanced Number Field
Functionality for Number Fields, like rounding or only absolute numbers, fixed point notation, range calculation, custom units like % or m2 & show as slider.
Update Multiple Entries
Trigger the update of multiple entries in a target form by submitting an entry in a trigger form.
API Connector
Connect Gravity Forms to External API's: Query the API using form field values and automatically fill other form fields with the API response.
Read tutorials about
How to Validate Repeatable Contact Rows in Gravity Forms
Learn how to validate repeatable Gravity Forms List field rows with GravityWP List Text. This tutorial shows how to add email and regex validation, test invalid values, and confirm that valid team roster data is stored correctly.
Gravity Forms Airtable Integration: Create Records From Form Submissions
Learn how to build a Gravity Forms Airtable integration with GravityWP API Connector. Send form submissions to Airtable, create new records automatically, and save the returned Airtable Record ID and response back to Gravity Forms.
Gravity Forms Asana Integration: Create Tasks From Form Submissions
Learn how to connect Gravity Forms to Asana with GravityWP API Connector. This tested workflow creates Asana tasks from form submissions and saves the returned task ID and URL back to Gravity Forms.
Gravity Forms Google Calendar Integration: Create Events From Form Submissions
Connect Gravity Forms to Google Calendar with GravityWP API Connector. Learn how to create calendar events from form submissions, map event details, configure OAuth 2.0, handle time zones, and save the returned Event ID and URL.