CrAzY hOuSe
Locos por la programación
Conocer si es año bisiesto.
.net

Syndication

Prueba esta función, si devuelve True es que es Bisiesto.

Function BisiestoSINO(Year As Date) As Boolean
    Dim Mod400 As Long, Mod100 As Long, Mod4 As Long
    
    BisiestoSINO = False 'Indica si es bisiesto o no
    Mod400 = Year Mod 400
    Mod100 = Year Mod 100
    Mod4 = Year Mod 4
    
    If (Mod400 = 0) Then BisiestoSINO = True
    If (Mod100 = 0) And (Mod400 <> 0) Then BisiestoSINO = False
    If (Mod4 = 0) And (Mod100 <> 0) Or ((Mod4 = 0) And (Mod400 = 0)) Then BisiestoSINO = True
End Function

Publicado en microsoft.public.es.asp por Pablo Viojo

Function BisiestoSINO(Year As Date) As Boolean
    BisiestoSINO = Day(DateSerial(Year(Fecha), 3, 0)) = 29
End Function

Tagen nos ha enviado otra función más cortita.


Posted dom, nov 11 2001 18:22 by Maverick
Filed under: ,

Add a Comment

(optional)  
(optional)
(required)  
Remember Me?
MavericK
Powered by Community Server (Non-Commercial Edition), by Telligent Systems