CFLib.org – Common Function Library Project

GetAshWednesday([TheYear])

Last updated September 04, 2001

author

Ken McCafferty

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Returns a date for Ash Wednesday in a given year. If no year is specified, defaults to current year.

Return Values:
Returns a date object.

Example:

<CFOUTPUT>
This year, Ash Wednesday is on #DateFormat(GetAshWednesday(), 'dddd, mmm dd')#.
</CFOUTPUT>

Parameters:

Name Description Required
TheYear Year you want to return Ash Wednesday for. No

Full UDF Source:

/**
 * Returns a date for Ash Wednesday in a given year.
 * This function requires the GetEaster() function available from the DateLib library.
 * 
 * @param TheYear      Year you want to return Ash Wednesday for. 
 * @return Returns a date object. 
 * @author Ken McCafferty (mccjdk@yahoo.com) 
 * @version 1, September 4, 2001 
 */
// Ash Wednesday: Seventh Wednesday before Easter
function GetAshWednesday() {
  Var TheYear=Year(Now());
  if(ArrayLen(Arguments)) 
    TheYear = Arguments[1];
  return DateAdd("D",-46,GetEaster(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