Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Source code related resources

Moderator: Rathinagiri

Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Post by Leopoldo Blancas »

Hola Checando mi rutina hay un error de dedo en:
*-----------------------------------------------------------
Checking my routine Hello there finger error:

Code: Select all

AADD(aMesesDias,{2,'FE[b]C[/b]BRERO',IIF(lBisiesto,29,28)})   // SOBRA LA "C"
Saludos
Polo
*----------------------------------------------
Regars
Polo
Leopoldo Blancas
Posts: 388
Joined: Wed Nov 21, 2012 7:14 pm
Location: México

Re: Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Post by Leopoldo Blancas »

Hola...

Para que este completa la rutina falta esta rutina mas:
*----------------------------------------------
Hello ...

For this complete lack this workout routine more:

Code: Select all

FUNCTION PosiArray(MiArray,cParam)
LOCAL n:= 0
LOCAL nPos := 0

   FOR n := 1 TO LEN(MiArray)
      IF ValType(cParam)== 'N'
         IF MiArray[n] == cParam
            nPos := n
         ENDIF
      ELSE
         IF UPPER(ALLTRIM(MiArray[n])) == UPPER(ALLTRIM(cParam))
            nPos := n
         ENDIF
      ENDIF
   NEXT n 

RETURN nPos
Saludos
Polo
*-------------------------
Regards
Polo
brunellopulix
Posts: 73
Joined: Sat Apr 24, 2010 10:17 am

Re: Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Post by brunellopulix »

Hi all

From clipper 5.2 .\Source\Sample\Date.prg


/***
*
* DateIsLeap( <dDate> ) --> lLeap
*
* Determine if the year of a supplied date is a leap year
*
*/
FUNCTION DateIsleap( dDate )

LOCAL nYear := YEAR( dDate )

RETURN (( nYear % 4 ) == 0 ) .AND. ;
((( nYear % 100 ) != 0 ) .OR. ;
(( nYear % 400 ) == 0) )


Brunello
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: Año(s), mes(es) y dia(s) transcurridos entre dos fechas

Post by esgici »

IsLeap( [<dDate>] ) -> lIsLeap // hbct
IsLeapYear( <dDate> ) --> lTrueOrFalse // hbmisc

http://www.elektrosoft.it/tutorials/Har ... htm#IsLeap
Viva INTERNATIONAL HMG :D
Post Reply