FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour dates of a mounth
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
dates of a mounth
Posted: Fri Mar 20, 2015 10:32 AM

Dear friends,
I need a function return me the init date and the end date of each mounth , I passed only the Year
How I can do it ?
Wich function i must use to have them ?
thanks

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 989
Joined: Thu Nov 24, 2005 03:01 PM
Re: dates of a mounth
Posted: Fri Mar 20, 2015 10:49 AM
Hi Silvio

You don't say how you want returned such a complex result like that, it at least has 24 dates. May be
Code (fw): Select all Collapse
FUNCTION GimmyTheDates( nYear )
   LOCAL aDates[ 12, 2 ]
   aEval( aDates, {|x, i| x[1]:= StoD( StrZero( nYear, 4 ) + StrZero( i, 2 ) + '01' ), x[2]:= EOM( x[1] ) } )

RETURN aDates

FUNCTION EOM( dDate )
   dDate+= 35 - Day( dDate )
RETURN dDate - Day(dDate)
Saludos
Carlos Mora
http://harbouradvisor.blogspot.com/
StackOverflow http://stackoverflow.com/users/549761/carlos-mora
“If you think education is expensive, try ignorance"
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: dates of a mounth
Posted: Fri Mar 20, 2015 11:09 AM
thanks
it is that I search
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: dates of a mounth
Posted: Fri Mar 20, 2015 12:57 PM

We need not have our own function EOM(d)
There is already a function EOM(d) in (x)Harbour.

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: dates of a mounth
Posted: Mon Mar 23, 2015 10:28 AM

thanks Rao

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Continue the discussion