How to convert atom date to date in PHP?

This post converting the Atom Date format to Date format with any format in php.

1. Code:

    <?php 	
	function convertAtomDateToDate($atomDate, $format = "Y-m-d"){
		$date = date($format, strtotime($atomDate));
		return $date;
	}
	
	$atomDate = "2019-10-15T07:00:00.000Z";
	echo(convertAtomDateToDate($atomDate));
    ?> 

2. Example:

Input:

"2019-10-15T07:00:00.000Z";

Output:

2019-10-15