TimeToMinutes (Function)
The TimeToMinutes function calculates the number of minutes from midnight for any 24-hour (HHMM) time value.
Syntax
TimeToMinutes(XTime)
Returns (Integer)
A numeric value containing the number of minutes between midnight and XTime.
Parameters
Name |
Type |
Description |
XTime |
Numeric |
Specifies a time in 24-hour format. |
Remarks
This function allows for the proper addition and subtraction of time. The first step when adding or subtracting a number of minutes from time is to convert the time to minutes through the use of the TimeToMinutes function.
Then, add or subtract the number of minutes, and, finally convert the number of minutes back to time using the MinutesToTime function.
XTime is a numeric simple type input and can be hard coded with a number or can be replaced by a numeric simple input.
Example
Assigns to Value1 the number of minutes since midnight, 150 in this case, based on a 24-hour time input equivalent to 2:30am.
Value1 = TimeToMintues(0230);