I'm trying to validate input in mm/yyyy
format by round tripping a string. The problem:
<?php
$datestr = "06/2017";
$realdate = DateTime::createFromFormat('m/Y', $datestr);
$datestr2 = date_format($realdate,'m/Y');
echo "date in: $datestr\n";
echo "date out: $datestr2\n";
?>
yields the following:
date in: 06/2017
date out: 07/2017
Why is the second value incremented a month?
var_dump()
them.