Help Center
Help CenterFreeBASIC

DateSerialfunction

Creates a date serial

Date and Time Functionsfunctiondocumented

Syntax

Declare Function DateSerial ( ByVal year As Long, ByVal month As Long, ByVal day As Long ) As Long

Parameters

NameDescription
yearthe year
monththe month of the year
daythe day of the month

Return value


Returns a date serial containing the date formed by the values in the year, month and day parameters.The date serial returned has no decimal part.

Description


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

Remarks

Usage


#include "vbcompat.bi"
result = DateSerial( year, month, day )

Differences from QB


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

See also


Example


#include "vbcompat.bi"



Dim a As Long = DateSerial(2005, 11, 28)



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

Reference

  • Documented in KeyPgDateSerial.html