CFLib.org – Common Function Library Project

GetTimeFromMinutes(Minutes)

Last updated November 06, 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);
}

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