DATETIME (Year, Month, Day, Hour, Minute, Second) DATETIME (Year; Month; Day; Hour; Minute; Second)

Year

Number Number

The year.

Month

Number Number

The month (1 through 12).

Day

Number Number

The day (1 through 31).

Hour

Number Number

The hour (0 through 23).

Minute

Number Number

The minute (0 through 59).

Second

Number Number

The second (0 through 59).

Returns

Temporal Temporal

A temporal value representing the given year, month, day, hour, minute and second.

Returns a temporal value representing the given year, month, day, hour, minute and second. Use DATE instead if no time of day is needed, and TIME instead if only a time of day is needed.

A component outside its natural range carries over into the neighboring components. Unlike TIME, which discards whole days, this function lets hours, minutes and seconds carry over into the date.

This function is not commonly supported by spreadsheets.

Examples

DATETIME (1981, 11, 14, 15, 30, 0)
DATETIME (1981; 11; 14; 15; 30; 0)

Returns a temporal value representing 3:30 PM on November 14, 1981.

DATETIME (2024, 1, 15, 25, 0, 0)
DATETIME (2024; 1; 15; 25; 0; 0)

Returns a temporal value representing 1:00 AM on January 16, 2024, as 25 hours is a day and an hour.

FORMAT.DATETIME ( DATETIME (1981, 11, 14, 15, 30, 0))
FORMAT.DATETIME ( DATETIME (1981; 11; 14; 15; 30; 0))

Returns "11/14/1981, 3:30 PM" if the configured locale is US English.

fxEngine Shell Want this in your own terminal? A standalone version is coming. Get notified.
Loading fxEngine Shell