Dim a As Integer
a = DateDiff(Date(0, 0, 0, 11, 00), Date(0, 0, 0, 12, 30), gb.Minute)
Print a
(07-11-2020, 17:43)guizans escribió: se puede usar Format$() para pasar esos 90 minutos a "1:30"?
Public Function SecondsToHMS(intTime As Integer) As Integer[]
Dim intH As Integer ' Horas
Dim intN As Integer ' Minutos
Dim intS As Integer ' Segundos
Dim stxTime As New String[]
Select intTime / 3600
Case 0
intH = 0
Case 1
intH = 1
intN = 0
Case Else
intH = intTime / 3600
Select (intTime Mod 3600) Mod 60
Case 0
intN = (intTime Mod 3600) / 60
intS = 0
Case Else
intN = (intTime Mod 3600) / 60
intS = (intTime Mod 3600) Mod 60
End Select
End Select
stxTime.Add(intH)
stxTime.Add(intN)
stxTime.Add(intS)
Return stxTime
End
(07-11-2020, 19:18)guizans escribió: Gracias tincho, me servirá
a = DateDiff(Date(0, 0, 0, 11, 00), Date(0, 0, 0, 12, 30), gb.Minute)
Print Format(Time(CInt(a / 60), a Mod 60, 0, 0), "hh:nn")
Public Sub Main()
Dim i As Integer
i = DateDiff(Date(0, 0, 0, 11, 00), Date(0, 0, 0, 12, 30), gb.Minute)
Print Format(Time(0, 0, 0, i * 60000)
End
(08-11-2020, 12:48)guizans escribió: pero lo he mejorado