Page 2 of 2

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

Posted: Fri Mar 15, 2013 4:37 pm
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

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

Posted: Fri Mar 15, 2013 4:51 pm
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

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

Posted: Sun Mar 17, 2013 9:10 am
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

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

Posted: Sun Mar 17, 2013 11:06 am
by esgici
IsLeap( [<dDate>] ) -> lIsLeap // hbct
IsLeapYear( <dDate> ) --> lTrueOrFalse // hbmisc

http://www.elektrosoft.it/tutorials/Har ... htm#IsLeap