make date from a string php code example
Example 1: create date from string php
$element = '15-Feb-2009';
$date = DateTime::createFromFormat('j-M-Y', $element);
Example 2: date to string in php
Date to string
$date = "2021/03/13";
$newdate= date('d M, Y', strtotime($date));
echo $newdate;