Siebel VB Language Reference > VB Language Reference >

Minute Function

This standard VB function returns the minute component (0-59) of a date-time value.





Any numeric or string expression that can evaluate to a date-time or time value


If the expression evaluates to a date-time or time value, the minute component of that value; otherwise 0.


Time can be of any type, including strings, and the Minute function attempts to convert the input value to a date-time value.

For Minute to function without an error, the values passed to it must be in some form that can be interpreted as a time or date-time value. Thus, 13:26, or 1:45:12 PM returns valid results, but 1326 returns a 0.

The return value is a variant of vartype 2 (integer). If the value of time is null, a variant of vartype 1 (Null) is returned.


This example extracts just the time (hour, minute, and second) from a file's last modification date and time.

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

See Also

Date Statement
DateSerial Function
DateValue Function
Day Function
Hour Function
Month Function
Now Function
Second Function
Time Statement
TimeSerial Function
TimeValue Function
WebApplet_InvokeMethod Event
Year Function

Siebel VB Language Reference