Mengkonversi durasi video youtube Api v3 menggunakan javascript

Contoh Javascript :

function covtime($youtube_time){
    $start = new DateTime('@0'); // Unix epoch
    $start->add(new DateInterval($youtube_time));
    return $start->format('H:i:s');
}   

echo covtime('PT2H34M25S'); //result 2:34:25

Amoga bermanfaat !!


Previous
Next Post »