TimeSerial (function)

Syntax

TimeSerial(hour,minute,second)

Description

Returns a Date variant representing the given time with a date of zero.

Comments

The TimeSerial function requires the following parameters:

 

Parameter

Description

 

hur

Integer between 0 and 23.

 

minute

Integer between 0 and 59.

 

second

Integer between 0 and 59.

Example

Sub Main()
  start# = TimeSerial(10,22,30)
  finish# = TimeSerial(10,35,27)
  dif# = Abs(start# - finish#)
  MsgBox "The time difference is: " & Format(dif#,"hh:mm:ss")
End Sub

See Also

DateValue (function); TimeValue (function); DateSerial (function).

More information

T