Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converting UTC to Local Time PHP
//Standart waktu di Indonesia
//Contoh Variable Waktu dengan format UTC
$timeutc = "2018-09-17T00:20:00Z";
//CONVERT UTC TO LOKAL dengan format tgl/bln/thn jam:menit:detik
$time1 = strtotime($timeutc.' UTC');
$format1 = date("Y-m-d H:i:s", $time1);
//CONVERT UTC TO LOKAL dengan format hanya jam:menit:detik
$time2 = strtotime($timeutc.' UTC');
$format2 = date("H:i:s", $time2);
echo "Contoh Konversi 1 : $format1 <br> Contoh Konversi 2 : $format2";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment