Extract Minute From Date-Time Value Method
The Extract Minute From Date-Time Value method returns the minute component of a date and time value. The return value is an integer variable type in the range of 0 through 59. If the return value is null, then this method returns a null variable type. For more information, see Variants.
Format
Minute(time)
The argument that this method uses is the same as the argument that the Convert String to Time method uses. For more information, see Convert String to Time Method.
If the value that the time argument contains does not evaluate to a date and time or to a time value, then this method returns 0 (zero). For example:
The value 13:26 or the value 1:45:12 PM returns a valid results.
The value 1326 returns a 0.
Example
The following example gets the hour, minute, and second of the last modification date and time of a file:
Sub Button_Click
Dim filename as String
Dim ftime
Dim hr, min
Dim sec
Dim msgtext as String
i: msgtext = "Enter a filename:"
filename = "d:\temp\trace.txt"
If filename = "" then
Exit Sub
End If
On Error Resume Next
ftime = FileDateTime(filename)
If Err <> 0 then
Goto i:
End If
hr = Hour(ftime)
min = Minute(ftime)
sec = Second(ftime)
End Sub