function dateIndo($date = 0, $day = false, $time = false, $format = 0) { // 0=01 Januari 1970,1 = 01/01/1970 $bulan = get_bulan_all(); $hari = get_hari_all(); $d = date('d', $date); $m = date('m', $date); $y = date('Y', $date); $n = date('N', $date); $t = date('H:i', $date); if ($day) { switch ($format) { case 0: $date = $hari[$n] . ", " . $d . " " . $bulan[$m] . " " . $y . " "; break; case 1: $date = "{$hari[$n]}, {$d}/{$m}/{$y} "; } } else { $date = $d . " " . $bulan[$m] . " " . $y . " "; } if ($time) { $date .= $t; } return $date; }
function dateIndoShort($date = "", $day = false, $time = false) { // 0=01 Januari 1970,1 = 01/01/1970 $bulan = get_bulan_short(); $hari = get_hari_all(); $d = date('d', strtotime($date)); $m = date('m', strtotime($date)); $y = date('Y', strtotime($date)); $n = date('N', strtotime($date)); $t = date('H:i', strtotime($date)); if ($day) { $date = $hari[$n] . ", " . $d . " " . $bulan[$m] . " " . $y . " "; } else { $date = $d . " " . $bulan[$m] . " " . $y . " "; } if ($time) { $date .= $t; } return $date; }