CFLib.org – Common Function Library Project

HoyToHour(hoy)

Last updated May 14, 2002

author

Billy Cravens

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Allows you to take an hour of the year and convert it to a numeric hour (like 23.5). Similar to CF's hour(date). Very useful in scheduling applications, where you would want records to have an absolute value within a specific year, but still need to look at them as the fit within a certain day.

Return Values:
Returns a number.

Example:

<cfoutput>
You start at: #hoyToHour(3498)#
</cfoutput>

Parameters:

Name Description Required
hoy Hour of the year. Yes

Full UDF Source:

/**
 * Converts hour of the year to hour of the day.
 * 
 * @param hoy 	 Hour of the year. (Required)
 * @return Returns a number. 
 * @author Billy Cravens (billy@fuzweb.com) 
 * @version 1, May 14, 2002 
 */
function hoyToHour(hoy) {
	return hoy - ((hoy \ 24)*24);
}
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