DEV Community

asepher
asepher

Posted on

Insert Date Format to MySQL

public function TglSimpan($tglindo)
{
    //27-07-2023
    $tgl     =  substr($tglindo,0,2);
    $bln    =  substr($tglindo,3,2); 
    $thn     =  substr($tglindo,6,4); 
    return  $thn.'/'.$bln.'/'.$tgl;
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)