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;
}
blog comments powered by Disqus

Search CFLib.org


Latest Additions

Kevin Cotton added
date2ExcelDate
May 5, 2016

Raymond Camden added
CapFirst
April 25, 2016

Chris Wigginton added
loremIpsum
January 18, 2016

Gary Stanton added
calculateArrival...
November 19, 2015

Sebastiaan Naafs - van Dijk added
getDaysInQuarter
November 13, 2015

Created by Raymond Camden / Design by Justin Johnson