day of year

Post Reply
User avatar
patili
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

day of year

Post by patili »

Hi,
i am looking about a function which returns the numeric value of the day in the year
ex function (01/01/06) return 1
function (31/12/06) reutrn 365
May be this function exist but i don't find it
Any idea? Thanks
User avatar
wmormar
Posts: 1050
Joined: Fri Oct 07, 2005 10:41 pm
Location: México
Contact:

Re: day of year

Post by wmormar »

patili wrote:Hi,
i am looking about a function which returns the numeric value of the day in the year
ex function (01/01/06) return 1
function (31/12/06) reutrn 365
May be this function exist but i don't find it
Any idea? Thanks
If use xHarbour

Code: Select all

DOY ([<dDate>])
William, Morales
Saludos

méxico.sureste
User avatar
patili
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Post by patili »

No i'm using Fivewin and clipper
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Patili,

Code: Select all

function Main()

   SET DATE FRENCH

   MsgInfo( Doy( CToD( "01/01/06" ) ) )

   MsgInfo( Doy( CToD( "31/12/06" ) ) )
   
return nil   

function DOY( dDate )

   local nMonth := Month( dDate )
   local nDay := 0
   
   while nMonth > 0 
      nDay += Day( dDate )
      dDate -= Day( dDate )
      nMonth--
   end
   
return nDay      
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
patili
Posts: 98
Joined: Mon Jan 23, 2006 9:34 am
Location: LE CREUSOT FRANCE

Post by patili »

And NOW it exist
Thank you Antonio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

You are welcome :)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply