Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Difference between two hours
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01011564
Message ID:
01011593
Vues:
14
Sergey,

a big big thank....
There is still a little problem
please try this code
FUNCTION test91()

WAIT WINDOW  TimeDiff_ut( "21:00" , "23:30")
*-- return "02:29"
ENDFUNC
*-- 05/2005 UT Thread no 1011564
FUNCTION TimeDiff_ut
  LPARAMETERS tcStartTime, tcEndTime

  LOCAL lnSec,;
  cValue 
  
  lnSec = CTOT(tcEndTime) - CTOT(tcStartTime)
  cValue = PADL(INT(lnSec/3600), 2, "0") + ":" + ;
    PADL(INT((lnSec%3600)/60),2, "0") && + ":"
     
  RETURN cValue

ENDFUNC
>If time difference < 24 hours
? TimeDiff("21:30", "23:33")
>
>FUNCTION TimeDiff
>LPARAMETERS tcStartTime, tcEndTime
>LOCAL lnSec
>lnSec = CTOT(tcEndTime) - CTOT(tcStartTime)
>RETURN PADL(INT(lnSec/3600), 2, "0") + ":" + ;
>		PADL(INT((lnSec%3600)/60),2, "0") + ":"
>
>>
>>
>>i search a utility program FOR calculate the result between two hours.
>>
>>Sample
>>
>>
>>Beginning   21:30
>>End         23:33
>>Difference  02:03 or 2.05 Hours
>>
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform