Hi I want to create DateTime object from date 1989-06-31. As you can see this date has bad count of days(June can't have 31 days). But calling this
$semi_valid_date = "1989-06-31";
$semi_valid_datetime = DateTime::createFromFormat('Y-m-d',$semi_valid_date);
$valid_date = $semi_valid_datetime->format('Y-m-d');
will store to $valid_date date 1989-07-01.
Is it possible to throw error, when month has more days, than it can have?