DOY()

DOY()

Determines the day of the year for a specific date

Syntax

       DMY( [<dDate>] ) -> nDayOfYear

Argument

<dDate> Designates which date to use to calculate the day of the year. The default is the system date.

Returns

DOY() returns a calendar day number that specifies which day of the year <dDate> represents.

Description

Determines the day of the year for a specific date if dDate is invalid, returns 0 If you frequently work with time periods, then this function is quite useful. DOY() lets you assign a calendar day number to a date that relates to the beginning of the year.

Note

. When no date is specified, DOY() uses the system date. January 1 is always 1, December 31 is 366 in a leap year; otherwise, it is 365. An empty date returns a 0 result.

Example

      ? DOY( hb_SToD( "20000131" ) ) // -> 31
      ? DOY( hb_SToD( "20000220" ) ) // -> 51

Compliance

DOY() is compatible with CT3’s DOY().

Platforms

All

Files

Source is dattime2.prg, library is libct.

Seealso

WOY()

Advertisements

2 responses to “DOY()

  1. Pingback: Harbour All Functions – D | Viva Clipper !

  2. Pingback: Harbour Date & Time Functions | Viva Clipper !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s