CFLib.org – Common Function Library Project

GetTimeFromMinutes(Minutes)

Last updated November 6, 2001

author

Rob Brooks-Bilson

Version: 1 | Requires: CF5 | Library: DateLib

Description:
Calculates time from minutes after midnight. The date part of a time variable is set to December 30, 1899.

Return Values:
Returns a date/time object.

Example:

<CFSET m=405>

<cfoutput>
Given m=#m#<BR>
#TimeFormat(GetTimeFromMinutes(m), 'HH:mm:ss')#
</cfoutput>

Parameters:

Name Description Required
Minutes Number of minutes elapsed since midnight. Yes

Full UDF Source:

/**
 * Calculates time from minutes after midnight.
 * 
 * @param Minutes 	 Number of minutes elapsed since midnight. 
 * @return Returns a date/time object. 
 * @author Rob Brooks-Bilson (rbils@amkor.com) 
 * @version 1, February 21, 2002 
 */
function GetTimeFromMinutes(minutes)
{
  Var tHr = (((minutes\60)-1) Mod 24)+1;
  Var tMin = minutes-(tHr*60);
  return CreateTime(tHr,tMin, 0);
}
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