# Calculate the date 18 months from a date field

**URL:** <https://community.gravityforms.com/t/calculate-the-date-18-months-from-a-date-field/17801>\
**Category:** Get Help\
**Tags:** gravity-wiz, date-field, gform\_datepicker\_options\_pre\_init\
**Created:** [July 3, 2024, 10:49pm UTC](https://community.gravityforms.com/t/calculate-the-date-18-months-from-a-date-field/17801 "2024-07-03T22:49:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user5f0f3d943fdaa958](https://avatars.discourse-cdn.com/v4/letter/u/d9b06d/32.png) [@user5f0f3d943fdaa958](https://community.gravityforms.com/u/user5f0f3d943fdaa958)\
**Post date:** [July 3, 2024, 10:49pm UTC](https://community.gravityforms.com/t/calculate-the-date-18-months-from-a-date-field/17801/1 "2024-07-03T22:49:05Z")

</div>

Hello,  
I have a form with a date field for when a process is first performed and then a radio button field with a selection of 12, 18, 24, and 36 months for a review process to happen.  
What would make things easier for me is to have a 2nd date field automatically take the first date and add the selected number of months.  
The second date field doesn’t have to be shown to the user in that form, but I’ll want it for a notification and, later, in a dashboard.  
I have seen suggestions that a Gravity Perk can help - Date Time Calculator - but this doesn’t seem to be one of that Perk’s capabilities.  
Thanks for any help

---

<div class="post-metadata">

**Author:** ![scott-the-sorceror](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/scott-the-sorceror/32/2772_2.png) [@scott-the-sorceror](https://community.gravityforms.com/u/scott-the-sorceror)\
**Post date:** [July 4, 2024, 5:50pm UTC](https://community.gravityforms.com/t/calculate-the-date-18-months-from-a-date-field/17801/2 "2024-07-04T17:50:45Z")

</div>

This snippet will do the trick.

> **[How to Populate and Modify Dates and Times with Gravity Forms](https://gravitywiz.com/populate-dates-gravity-form-fields/)**
>
> Use Gravity Forms to Auto Populate Date fields (or any text-based field) with a modified date based on the current date or a user-submitted date.

[You can set the value of your radio buttons field as the modifier](https://gravitywiz.com/populate-dates-gravity-form-fields/#modify-date-by-field-value). Rough example:

```auto
new GW_Populate_Date( array(
	'form_id' => 1895,
	'target_field_id' => 2,
	'source_field_id' => 1,
	'modifier' => array(
		'type' => 'field',
		'inputId' => 3, // Radio Buttons field ID.
		'modifier' => '+{0} days',
	),
) );

```

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [August 3, 2024, 5:51pm UTC](https://community.gravityforms.com/t/calculate-the-date-18-months-from-a-date-field/17801/3 "2024-08-03T17:51:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
