Returns the current date and time as a DateTime value, or creates a year 2000-compliant DateTime value.

DATETIME([nYear, nMonth, nDay [, nHours [, nMinutes [, nSeconds]]]])

Parameters

nYear

Specifies the year returned in the year 2000-compliant DateTime value. nYear can be a value from 100 to 9999.

nMonth

Specifies the month returned in the year 2000-compliant DateTime value. nMonth can be a value from 1 to 12.

nDay

Specifies the day returned in the year 2000-compliant DateTime value. nDay can be a value from 1 to 31.

nHours

Specifies the hours returned in the year 2000-compliant DateTime value. nHours can be a value from 0 (midnight) to 23 (11 P.M). Defaults to 0 if omitted.

nMinutes

Specifies the minutes returned in the year 2000-compliant DateTime value. nMinutes can be a value from 0 to 59. Defaults to 0 if omitted.

nSeconds

Specifies the seconds returned in the year 2000-compliant DateTime value. nSeconds can be a value from 0 to 59. Defaults to 0 if omitted.

Expand imageReturn Value

Expand imageRemarks

Expand imageExample

Expand imageSee Also