libs/general_function.php
//** Format Tanggal YYYY-MM-DD **//
Format Tanggal YYYY-MM-DD
Format Tanggal YYYY - MM - DD
function dateToEn($date){
	$date_en 	 = date("Y-m-d H:i:s", $date);
	$date_i 	 = date('Y-m-d', strtotime($date_en));
	$month_array = date('m', strtotime($date_en));
	$dateObj   	 = DateTime::createFromFormat('!m', $month_array);
	$month 		 = $dateObj->format('F');
	$date 		 = date('d', strtotime($date_en));
	$year 		 = substr($date_en, 0 , 4);
	$monthName 	 = substr($month, 0 , 3);
	if($date_i == '1970-01-01'){
		return '';
	} else {
		return $monthName." ".$date.", ".$year;
	}
}
function dateToEn ( $ date ) { $ date_en = date ( " Y-m-d H:i:s " , $ date ) ; $ date_i = date ( 'Y-m-d' , strtotime ( $ date_en ) ) ; $ month_array = date ( 'm' , strtotime ( $ date_en ) ) ; $ dateObj = DateTime :: createFromFormat ( '!m' , $ month_array ) ; $ month = $ dateObj -> format ( 'F' ) ; $ date = date ( 'd' , strtotime ( $ date_en ) ) ; $ year = substr ( $ date_en , 0 , 4 ) ; $ monthName = substr ( $ month , 0 , 3 ) ; if ( $ date_i == '1970-01-01' ) { return '' ; } else { return $ monthName . " " . $ date . " ,  " . $ year ; } }
Format Tanggal YYYY-MM-DD
Format Tanggal YYYY - MM - DD