Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to compute two time intervals
Message
De
22/08/2001 10:08:30
 
 
À
22/08/2001 04:56:44
Victor Lapid
Phil. Long Distance Tel. Co.
Manila, Philippines
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00547127
Message ID:
00547238
Vues:
13
>Hi,
>
> I've wanted to compute between two time intervals express in HH:MM:SS
>
>EX. 08/22/01 09:20:01 AM - 08/22/01 09:15:01 AM would give me a value
> of 08/22/01 00:05:00
>
> I'm trying to use datediff function but not working for me. Maybe
> my syntax is incorrect.
>
>

If it's on the same date (and VB6) you can use direct date arithmetic to calculate the time elapsed between two datetime values and then format it like so:
Format$(StartDate - EndDate, "hh:mm:ss")
You can probably use a combination of DateDiff() & DateAdd for this also. Although for something like this you would probably need to calculate the necessary intervals separately (days, hours, minutes and seconds) and then construct a date var with that to feed to the DateAdd.

HTH
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform