How do I change the date format using PHP? I have used the following code but it is displaying the date input field value as m-d-Y. Why it is changing the format?
$effectivedate = date('M-d-Y', strtotime($empCompensationdata-effective_date));
$effective_date = date('Y-m-d', strtotime($empCompensationdata-effective_date));
$("#effective_date").val($effectivedate);
$('#effective_date').attr('data-value', $effective_date);