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);
}

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