I am inputting a date field, manipulating it, and then want to out put it in anotherdate field
I first parse the date, manipulate into a string. My conversiom of that string to date is not working. It seems to be producing another string variable.
Here is my code and output
//{newdate} is the manipulated field
{newdate} = {currYear}."-".{fillMonth}."-".{fillDay};
$nd = {newdate};
echo " Phase I nd = $nd ", “
”;
$typ = gettype($nd);
echo " Phase I nd is type ", $typ, “
”;
$date = strtotime($nd);
echo " $ date is ", $date, “
”;
$typ = gettype($date);
echo " Phase I date type is type ", $typ, “
”;
$ddd = date(‘Y-m-d’, $date);
$typ = gettype($ddd);
echo " $ ddd is ", $ddd, “
”;
echo " Phase I $ ddd type is type ", $typ, “
”;
My output is:
Phase I nd = 2021-05-19
Phase I nd is type string
$ date is 1621396800
Phase I date type is type integer
$ ddd is 2021-05-19
Phase I $ ddd type is type string
Can anyone help?