Visual Basic - Año bisiesto

Life is soft - evento anual de software empresarial
 
Vista:

Año bisiesto

Publicado por molovik (1 intervención) el 23/08/2005 17:51:43
Hola a todos

estoy desarollando un calendario en vb6 y necesito saber si el año actual es o no bisiesto.

Espero que alguien pueda darme algún código, aunque creo que no debe ser tan difícil como parece...

Muchísimas gracias de anticipado.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Año bisiesto

Publicado por miguel (1042 intervenciones) el 23/08/2005 18:07:31
Prueba con esto:
Private Sub Form_Load()
'If BICIESTO(Year(Now)) Then
If BICIESTO(2004) Then
MsgBox "Año Biciesto", vbInformation, "mIgUeL aNgEl"
Else
MsgBox "Año No Biciesto", vbInformation, "mIgUeL aNgEl"
End If
End Sub

Function BICIESTO(Año As Integer) As Boolean
BICIESTO = False
If (Año Mod 4 = 0 And Año Mod 100 <> 0) Or Año Mod 400 = 0 Then
BICIESTO = True
Exit Function
End If
End Function
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar