CFLib.org – Common Function Library Project

GetFathersDay([TheYear])

Last updated August 22, 2001

author

Ken McCafferty

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Return a date for Father's Day in a given year. If no year is specified, defaults to the current year.

Return Values:
Returns a date object

Example:

<CFOUTPUT>
This year, Father's Day is on #DateFormat(GetFathersDay(), 'dddd, mmm dd')#.
</CFOUTPUT>

Parameters:

Name Description Required
TheYear The year you want to return Father's Day for. No

Full UDF Source:

/**
 * Return a date for Father's Day in a given year.  If no year is specified, defaults to the current year.
 * This function requires the GetNthOccOfDayInMonth() function available from the DateLib library. Minor modifications by Rob Brooks-Bilson (rbils@amkor.com)
 * 
 * @param TheYear      The year you want to return Father's Day for. 
 * @return Returns a date object 
 * @author Ken McCafferty (mccjdk@yahoo.com) 
 * @version 1.0, August 22, 2001 
 */
//Father's:third sunday in june
function GetFathersDay() 
{
  Var TheYear=Year(Now());
  if(ArrayLen(Arguments)) 
    TheYear = Arguments[1];
  return CreateDate(TheYear,6,GetNthOccOfDayInMonth(3,1,6,TheYear));
}

Search CFLib.org


Latest Additions

Raymond Camden added
QueryDeleteRows
November 04, 2017

Leigh added
nullPad
May 11, 2016

Raymond Camden added
stripHTML
May 10, 2016

Kevin Cotton added
date2ExcelDate
May 05, 2016

Raymond Camden added
CapFirst
April 25, 2016

Created by Raymond Camden / Design by Justin Johnson