AppForge - Urgente : Lapso de tiempo en AppForge

 
Vista:

Urgente : Lapso de tiempo en AppForge

Publicado por Adictman (1 intervención) el 18/04/2007 17:05:13
Hola.
Mi aplicación para Palm Treo 650 necesita saber el lapso de tiempo que demora en bajar datos desde una URL y para ello tengo lo siguiente:

Public TSpan As TimeSpan
Public DTInicio As DateTime
Public DtFinal As DateTime
DTInicio = DateTime.Parse(Now)
Se conecta a Url y se bajan archivos
DtFinal = DateTime.Parse(Now)
TSpan = DtFinal.Subtract(DTInicio).Duration
LblTime.Caption = TSpan.Hours.ToString & ":" & TSpan.Minutes.ToString & ":" & TSpan.Seconds.ToString

El problema que tengo es que en la palm el tiempo esta en HH:MM 24 (Ejemplo : 03:34 PM), por tanto solo muestra hora y minutos, pero a veces la conexión demora segundos y estas no las reflejas (Muestra en cero siempre los segundos), me podría alguien decir como hago para que me muestra los segundos tambien que demora la bajada de archivos. Gracias
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:Urgente : Lapso de tiempo en AppForge

Publicado por Jorge Luis (1 intervención) el 23/04/2007 17:30:11
prueba esta función:

Private Function fncObtenerHoraExacta() As String
Dim strLetasHora As String
Dim intInicioL As Integer

#If APPFORGE Then
intInicioL = InStr(1, FormatDateTime(Now, vbLongTime), "PM")
#Else
intInicioL = InStr(1, FormatDateTime(Now, vbLongTime), "p.m.")
#End If

If intInicioL > 0 Then
strLetasHora = Mid(FormatDateTime(Now, vbLongTime), intInicioL)
Else
#If APPFORGE Then
intInicioL = InStr(1, FormatDateTime(Now, vbLongTime), "AM")
#Else
intInicioL = InStr(1, FormatDateTime(Now, vbLongTime), "a.m.")
#End If
strLetasHora = Mid(FormatDateTime(Now, vbLongTime), intInicioL)
End If

#If APPFORGE Then
fncObtenerHoraExacta = Left(FormatDateTime(Now, vbLongTime), intInicioL - 2) & ":" & Second(Time) & " " & strLetasHora
#Else
fncObtenerHoraExacta = FormatDateTime(Now, vbLongTime)
#End If

End Function

Jorge Luis Campos M.
VersiónTI
León, Gto. México.
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