Generate date based on current date & location [RESOLVED]

Is it possible to generate a date based upon current date and location? My client currently has this bit of php in his html website to achieve this, we’re moving the site to WP and I’m looking to find a solution using gravity forms. Thanks for any help!!

Current code

// If the country is set to Ireland
								if ($_POST[country] == "ireland") {
									$booked_date = date("jS F Y", strtotime("14 weekdays"));
	
								}
								// If the country is not set to Ireland
								else {
									$booked_date = date("jS F Y", strtotime("10 weekdays"));
								}
								
								$date = strtotime($booked_date);
								$date = date("l", $date);
								$date = strtolower($date);
								if($date == "saturday") {
									$booked_date = date("jS F Y", strtotime($booked_date . ' + 2 day'));
								}
								if($date == "sunday") {
									$booked_date = date("jS F Y", strtotime($booked_date . ' + 1 day'));
								} 

You can use your current code combined with the following filter to dynamically populate single input fields: gform_field_value_$parameter_name - Gravity Forms Documentation

Note that if you’re going to populate a datepicker field, you would need to return the date according to the Date Format setting of the datepicker field. So the format used in your current code wouldn’t work. If you want to use that format, then you can use a Hidden field or Single Line Text field.

You would need also to configure the field to accept dynamic population as described here: Dynamically Populating a Field - Gravity Forms Documentation

If you don’t need the field to be shown to the user, and just want to save the value returned by your code, you can use this other filter instead which doesn’t require dynamic population setup: gform_save_field_value - Gravity Forms Documentation