CFLib.org – Common Function Library Project

ISODayOfWeek(date)

Last updated August 17, 2001

author

Rob Brooks-Bilson

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Returns the ordinal for the day of the week for the specified date/time object according to ISO standards. ISO standards use Monday as the first day of the week as opposed to CF's built in DayOfWeek() function, which uses Sunday as the first day.

Return Values:
Returns an integer between 1 and 7.

Example:

<CFOUTPUT>
Today is day #ISODayOfWeek(Now())# of the week
</CFOUTPUT>

Parameters:

Name Description Required
date Date time object Yes

Full UDF Source:

/**
 * Returns the ordinal for the day of the week for the specified date/time object according to ISO standards.
 * 
 * @param date      Date time object 
 * @return Returns an integer between 1 and 7. 
 * @author Rob Brooks-Bilson (rbils@amkor.com) 
 * @version 1, August 17, 2001 
 */
function ISODayOfWeek(date)
{
  if (DayOfWeek(date) EQ 1) 
    Return 7;
  else 
    Return DayOfWeek(date)-1;
}

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