Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Diferences between 2 given hours
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00740516
Message ID:
00740532
Views:
17
This message has been marked as the solution to the initial question of the thread.
>How do i calculate the minutes between to given hours? does any body have a function top do so?

-- Diference between 2 DateTimes
http://www.portalfox.com/article.php?sid=140
*-----------------------------
* FUNCTION Dif_DHMS(ttIni,ttFin)
*-----------------------------
* Developer: Luis María Guayán, 03 Apr 2001
* Calculate Difference betwen DateTime 
* variables, and Returns Formated:
* ### Days, ## Hour, ## Minutes, ## Seconds
*-----------------------------
FUNCTION Dif_DHMS(ttIni,ttFin)
  LOCAL ln, lnDia, lnHor, lnMin, lnSeg
  IF EMPTY(ttFin)
    ttFin = DATETIME()
  ENDIF
  ln = ttFin - ttIni
  lnSeg = MOD(ln,60)
  ln = INT(ln/60)
  lnMin = MOD(ln,60)
  ln = INT(ln/60)
  lnHor = MOD(ln,24)
  lnDia = INT(ln/24)
  RETURN ALLTRIM(STR(lnDia))+ " Days, "+ ;
    TRAN(lnHor, "@L 99")+ " Hours, "+ ;
    TRAN(lnMin, "@L 99")+ " Minutes, "+ ;
    TRAN(lnSeg, "@L 99")+ " Seconds"
ENDFUNC
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Reply
Map
View

Click here to load this message in the networking platform