Well, if you look at the specification for the format when creating it:
Y years
M months
D days
W weeks. They are converted to days, so they cannot be combined with D.
H hours
M minutes
S seconds
, (http://php.net/manual/en/dateinterval.format.php), , :
$dateInterval = new DateInterval( );
$format = $dateInterval->format("P%yY%mM%dD%hH%iM%sS");
$format = str_replace(["M0S", "H0M", "D0H", "M0D", "Y0M", "P0Y"], ["M", "H", "D", "M", "Y0M", "P"], $format);
echo $format;
, , -, , 0. , minutes months M - , , , , . , , P PT, , a M Minute.
:
new DateInterval("P3M");
new DateInterval("PT3M"));
:
new DateInterval("P3M");
new DateInterval("P0M3M"));