LastDayOM()

LastDayOM()

Determines the number of days in a month

Syntax

       LastDayOM([<dDate|nMonth>]) --> nDaysInMonth

Argument

<dDate|nMonth> Designates either a date or the number of a month.The default is the system date.

Returns

LastDayOM() returns the number of days in the month specified by <dDate|nMonth>.

Description

<dDate|nMonth> can be a date or a month number. If empty uses the system date. If nMonth is a 2, lastdayom() will not know if it is a leap year or not. If dDate is invalid, returns 0 To administer due dates and other similar dates, it is useful to know the number of days that remain in a month. Specify either the day’s date or month as a parameter, and you get the length of the month in days. If you subtract the number of days until today’s date, you are left with the days that remain until month end.

Note

. Without the <dDate|nMonth> parameter, the function automatically uses the system date. If there is an invalid number of months, LastDayOM() returns 0 as an error code.

Example

       How many days remain before the end of the month?
           ? DATE(), LastDayOM()
           ? "There are " + STR(LastDayOM() - DAY( DATE() ), 2) +;
              " days until the end of the month"

Compliance

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

Platforms

All

Files

Source is dattime2.prg, library is libct.

Seealso

EOM()

Advertisements

2 responses to “LastDayOM()

  1. Pingback: Harbour All Function – L | 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