Initial commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
if (!function_exists('tanggal_indo')) {
|
||||
function tanggal_indo($tanggal, $format = 'd F Y')
|
||||
{
|
||||
if (empty($tanggal) || $tanggal == '0000-00-00') {
|
||||
return '-';
|
||||
}
|
||||
|
||||
$bulan = [
|
||||
1 => 'Januari',
|
||||
'Februari',
|
||||
'Maret',
|
||||
'April',
|
||||
'Mei',
|
||||
'Juni',
|
||||
'Juli',
|
||||
'Agustus',
|
||||
'September',
|
||||
'Oktober',
|
||||
'November',
|
||||
'Desember'
|
||||
];
|
||||
|
||||
$timestamp = strtotime($tanggal);
|
||||
|
||||
$hari = date('d', $timestamp);
|
||||
$bulan_index = (int)date('m', $timestamp);
|
||||
$tahun = date('Y', $timestamp);
|
||||
|
||||
return $hari . ' ' . $bulan[$bulan_index] . ' ' . $tahun;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user