Siebel VB Language Reference > VB Language Reference >
TimeSerial Function
This standard VB function returns a time as a variant of type 7 (date/time) for a specific hour, minute, and second. Syntax
TimeSerial(hour, minute, second)
|
|
hour |
A numeric expression containing a value from 0 to 23 representing an hour |
minute |
A numeric expression containing a value from 0 to 59 representing a minute |
second |
A numeric expression containing a value from 0 to 59 representing a second |
Returns
A time as a specific hour, minute, and second. Usage
You also can specify relative times for each argument by using a numeric expression representing the number of hours, minutes, or seconds before or after a certain time. Example
This example displays the current time using TimeSerial. Sub Button_Click Dim y As Variant Dim msgtext As String Dim nowhr As Integer Dim nowmin As Integer Dim nowsec As Integer nowhr = Hour(Now) nowmin = Minute(Now) nowsec = Second(Now) y = TimeSerial(nowhr,nowmin,nowsec) msgtext = "The time is: " & y End Sub
Related Topics
DateSerial Function DateValue Function Hour Function Minute Function Now Function Second Function TimeValue Function
|