<?php
function data($date){
	if(strlen($date) == 10){
		$gg = substr($date,0,2);
		$mm = substr($date,3,2);
		$aaaa = substr($date,6,4);
		$date = $aaaa.'-'.$mm.'-'.$gg;
		return $date;
	}else{
		return '0000-00-00';
	}
}
function ora($ora){
	if(strlen($ora) == 5){
		return $ora.':00';
	}else{
		return '00:00:00';	
	}
}
?>