based on this code :
$tarikh = mysql_real_escape_string($_POST['tarikh']);
$tarikh = date('Y-m-d', strtotime($_POST['tarikh']));
can someone show me to convert the format from Y-m-d to d-m-Y format ? thanks
based on this code :
$tarikh = mysql_real_escape_string($_POST['tarikh']);
$tarikh = date('Y-m-d', strtotime($_POST['tarikh']));
can someone show me to convert the format from Y-m-d to d-m-Y format ? thanks
try this
$tarikh = mysql_real_escape_string($_POST['tarikh']);
$myDateTime = DateTime::createFromFormat('Y-m-d', $tarikh);
$newDateString = $myDateTime->format('d-m-Y');