I'm trying to convert a date in WordPress Gravity Forms from dmy to Unix, which works fine by adding the below to functions.php but I want to add a +1 year to the converted date. Where am I going wrong?
function rkv_datesubmit_fix2 ($form){
//ACTUAL START DATE FIELD, date field id is 601 in gravity forms
$raw_srt = $_POST['input_601'];
$raw_end = $_POST['input_602'];
// convert dates to unix
$fix_srt = strtotime ($raw_srt);
$fix_end = strtotime($raw_end);
//output to gravity forms field 603 (start date)
//output to gravity forms field 604 (end date)
$_POST['input_603'] = $fix_srt;
$_POST['input_604'] = $fix_end;
}
add_action('gform_pre_submission', 'rkv_datesubmit_fix2');
If it change $fix_srt = strtotime ($raw_srt);
to strtotime('+ 1 year', $raw_srt);
I get 1971/1/1, not the original input date from Gravity field 601 plus a year.