calculating date problem

gstyles

Member
Good day all, I have a date field in a table called gypsum, date_of_test and I am trying to add an element that will add 1 year to this date with the following code in a calc element



$testdate = '{gypsum___date_of_test}';
$testdate = $testdate +1;
return $testdate;

This sort of works but only displays the year i.e. 2013 I would like it to display the full date i.e. 1/10/2013 I have played around with the Format string field but this just seems to return whatever I put in that field.
Could someone tell me what I need to do. Thanks gws.
 
Solved

For any one else having this problem,this works.
$date = '{gypsum___date_of_test_raw}';
return '' . date('d-m-Y', strtotime(date("d-m-Y", strtotime($date)) . " +1 year"));
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top