Skip to content

@Kristories /gist:3509222
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Custom Date (Bahasa Indonesia) Helper
function custom_date($timestamp = NULL, $format = 'd F, Y')
{
$l = array('', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jum\'at', 'Sabtu', 'Minggu');
$F = array('', 'Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni', 'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember');
$return = '';
if(is_null($timestamp)) { $timestamp = mktime(); }
for($i = 0, $len = strlen($format); $i < $len; $i++) {
switch($format[$i]) {
case '\\' :
$i++;
$return .= isset($format[$i]) ? $format[$i] : '';
break;
case 'l' :
$return .= $l[date('N', $timestamp)];
break;
case 'F' :
$return .= $F[date('n', $timestamp)];
break;
default :
$return .= date($format[$i], $timestamp);
break;
}
}
return $return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.