Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference > Siebel VB Language Reference >
Minute Function
This standard VB function returns the minute component (0-59) of a date-time value.
Syntax
Minute(time)
Argument Description time Any numeric or string expression that can evaluate to a date-time or time value
Returns
If the expression evaluates to a date-time or time value, the minute component of that value; otherwise 0.
Usage
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.
Example
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 SubSee 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
Bookshelf Home | Contents | Index | Search | PDF |
Siebel VB Language Reference Published: 18 June 2003 |