Ver Mensaje Individual
Antiguo 25-jul-2005, 00:38   #78 (permalink)
perrogrun
perrogrun está en el buen camino
 
Fecha de Ingreso: enero-2004
Mensajes: 266
Función istime

Función istime para saber si una hora es correcta o no

Código:
function istime(data)
data = replace(data,".",":")
	if instr(data,":")<>0 then
		hora = trim(left(data,instr(data,":")-1))
		minutos = trim(mid(data,instr(data,":")+1,len(data)))
		if isnumeric(hora) then
			if hora>=0 and hora <24 then
				istime = true
				if isnumeric(minutos) then
					if minutos>=0 and minutos <60 then
						istime = true
					else
						istime = false
					end if
				else
					istime = false
				end if
			else
				istime = false
			end if
		else
			istime = false
		end if
	else
		istime = false
	end if
	
end function
Forma de usarla:

if istime("12:45") then
codigo
else
codigo
end if
__________________
Programador de Nicenova Consulting, posicionamiento en buscadores, alta en buscadores y Google Maps
perrogrun está desconectado   Responder Citando