$tiempoMod = time() - 16200; if($sinhora=="1"){ return date("Y-m-d",$tiempoMod); }else{ return date("Y-m-d H:i:s",$tiempoMod); }