Brian Dunning's FileMaker Custom Functions

MonthLen ( themonth ; theyear )

Returns the number of days in the given month of the given year

  Average rating: 4.5 (28 votes) Log in to vote

Theo Ros   Theo Ros
*
http://notapplicable.com

Share on Facebook Share on Twitter

  Sample input:
MonthLen ( 2 ; 1900 )
  Sample output:
28

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Because the MonthLength() function by Andrew Sasaki uses the Julian Calendar method of determining the leapyear, the results can be wrong.

This better function works for both the Julian and the Gregorian calendar

Returns the length of the month given in the year given

Return type: Number
Syntax: MonthLen ( themonth ; theyear )

In: themonth - integer value ( 1-12 ). If empty, the current
month is assumed
theyear - the year to check (not a date, but an integer)
if theyear is earlier than 1583, the Julian Calendar
is assumed.
If empty, the current year is assumed

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Under construction. Email me your wish list for improvements.