A
|
acpan 10/13/2021 |
Try enquote your string like this: $values["Date"] = date("Y-m-d", strtotime (' " ' +$values["Date"]. '+ '. $values["Repeat"]. ' days' + ' " ') ); Alternately, you can form the $next_date as string first then apply the strtotime funciton for ease of troubleshooting: : // Verify your date value, in case it is invalid: |
L
|
luchoadmin author 10/14/2021 |
hello thank you very much for answering! I tested your code and after several tests and changes, I managed to get the following code to work, $myDate= $values["Fecha"]; but when in $ nDays I add the following, $ nDays = $ values ['Repeat']; It doesn't work, I don't know what I'm doing wrong. $myDate= $values["Fecha"]; thanks greetings |
![]() |
Myr0n 10/15/2021 |
maybe the value in $values['Repeticion'] is null or something different than a number if that is the case convert the value in integer like the next code $myDate= $values["Fecha"]; |
A
|
acpan 10/15/2021 |
+1 to myrOn's suggestion. You are very close and i think the issue is with $values['Repeticion"] by taking the isolation approach suggested. Echo it out and see the monster. |
L
|
luchoadmin author 10/17/2021 |
Hello dears, the code worked as follows! Thank you very much and I hope it serves other forum users $myDate= $values["Fecha"]; $medida = years months and days |
A
|
acpan 10/17/2021 |
Great! would appreciate if you can explain what caused the error? Can't really tell from your last message what you have done that fixed the issue with a new field, $medida= $values["elemento_ano"]; |
L
|
luchoadmin author 10/24/2021 |
Hello, sorry for the delay, I do not receive the notifications of new comments to the email, it would be good !!! thank you by |