MakeDateTime Function

Action

Generates and returns a DATETIME value constructed from the arguments you supply.

Syntax

Datetime = MakeDateTime (iYear, iMonth, iDay [,iHour, iMinute, iSecond, iMicrosec])
Variable Description
Datetime The generated date and time. DATETIME.
iYear The full year value (century included). INTEGER.
iMonth The month (1 - 12). INTEGER.
iDay The day (1 - 31). INTEGER.
iHour Optional: The hour value in 24-hour format (0 - 23). INTEGER.
iMinute Optional: The minute (0 - 59). INTEGER.
iSecond Optional: The second (0 - 59). INTEGER.
iMicrosec Optional: The microsecond (0 - 9999999). INTEGER.

Notes

  • The DATETIME data type represents values from 4713 BC to 19999 AD. Use a negative value to represent BC dates.

  • If you do not specify the optional parameters, this function sets the time to midnight.

Example

// Specify a date of Jan. 2, 1996 at 8:15 AM
datetime = MakeDateTime (1996, 1, 2, 8, 15)