Forum
Calc Builder Support
Calc Builder supportForums
No se permite escribir sin estar logado. Por favor, login
Date difference 18.07.2018 17:42
Hello,
I am experiencing trouble finding the difference between two dates. I have tested the code on other php editors and it has worked fine.
The code I have used is as follows:
$tax_2018=date_create("2018-4-5");
$ysp = $tax_2018->diff($DofP);
$ysp=$ysp->y;
DofP is a date input field. I am trying to find the number of years between 2018-4-5 and the date entered into DofP.
Any help would be appreciated.
Thanks,
Sam
I am experiencing trouble finding the difference between two dates. I have tested the code on other php editors and it has worked fine.
The code I have used is as follows:
$tax_2018=date_create("2018-4-5");
$ysp = $tax_2018->diff($DofP);
$ysp=$ysp->y;
DofP is a date input field. I am trying to find the number of years between 2018-4-5 and the date entered into DofP.
Any help would be appreciated.
Thanks,
Sam
Re: Date difference 19.07.2018 10:14
Hello,
the right way to do it would depend on the date format you set for your input field. We suggest to try to convert it directly into a date
$ysp = $tax_2018->diff(date_create($DofP));
in case you have set that same date format you're using for the fixed date "2018-4-5"
Hope this helps, regards
Moonsoft Team
www.moonsoft.es
the right way to do it would depend on the date format you set for your input field. We suggest to try to convert it directly into a date
$ysp = $tax_2018->diff(date_create($DofP));
in case you have set that same date format you're using for the fixed date "2018-4-5"
Hope this helps, regards
Moonsoft Team
www.moonsoft.es