Help Center
Help Center›FreeBASIC

TimeSerialfunction

Gets a Date Serial for the specified hours, minutes, and seconds

Date and Time Functionsfunctiondocumented

Syntax

Declare Function TimeSerial ( ByVal hour As Long, ByVal minute As Long, ByVal second As Long ) As Double

Parameters

NameDescription
hournumber of hours, in the range 0-23
minutenumber of minutes
secondnumber of seconds

Return value


Returns a date serial containing the time formed by the values in the hours, minutes and seconds parameters.The date serial returned has no integer part.

Description


hours must be specified in the range 0-23

The compiler will not recognize this function unless vbcompat.bi or datetime.bi is included.

Remarks

Usage


#include "vbcompat.bi"
result = TimeSerial( hours, minutes, seconds )

Differences from QB


  • Did not exist in QB. This function appeared in PDS and VBDOS

See also


Example


#include "vbcompat.bi"



Dim ds As Double = DateSerial(2005, 11, 28) + TimeSerial(7, 30, 50)



Print Format(ds, "yyyy/mm/dd hh:mm:ss")


Reference

  • Documented in KeyPgTimeserial.html