Visual Basic - FECHAS

Life is soft - evento anual de software empresarial
 
Vista:

FECHAS

Publicado por SILVERIO (2 intervenciones) el 02/06/2005 20:51:02
COMO SUMAR FECHAS EN VISUL BASIC 6.0 Y COMO PONER LA HORA DESDE LA PC
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:FECHAS

Publicado por test recargado (49 intervenciones) el 02/06/2005 22:42:19
prueba con esto perrin

Function SumaCampos(H1 As Date, H2 As Date) As Double
Dim Seg As Integer
Dim Min As Integer
Dim Hor As Integer

Seg = Second(H1) + Second(H2)
Min = Minute(H1) + Minute(H2)
Hor = Hour(H1) + Hour(H2)

If Seg >= 60 Then
Seg = Seg - 60
Min = Min + 1
End If

If Min >= 60 Then
Min = Min - 60
Hor = Hor + 1
End If

Text1 = Hor & ":" & Min & ":" & Seg

End Function

y la llamas con este codigo

Text1.Text = Format(HORA1.Text, "hh:mm:ss")
Text2.Text = Format(HORA2, "hh:mm:ss")
Text3 = SumaCampos(Text1.Text, Text2.Text)

la hora la sacas directamente con el commando TIME

Xaus... , cualquier duda me avisas
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