DATETIME
- DATETIME(year, month, day, hours, minutes, seconds)[source]
Constructs a datetime from the given year, month, day, hour, minute, and second components.
The DATETIME function returns a valid datetime using the specified components. It supports both single values and arrays; if arrays are provided, they must all have the same length, otherwise the returned formula will evaluate to an error.
- Parameters:
year (
Operand|int) –The year component.
Supported types:
INTEGER
INTEGER_ARRAY
month (
Operand|int) –The month component (1–12).
Supported types:
INTEGER
INTEGER_ARRAY
day (
Operand|int) –The day component.
Supported types:
INTEGER
INTEGER_ARRAY
hours (
Operand|int) –The hour component (0–23).
Supported types:
INTEGER
INTEGER_ARRAY
minutes (
Operand|int) –The minute component (0–59).
Supported types:
INTEGER
INTEGER_ARRAY
seconds (
Operand|int) –The second component (0–59).
Supported types:
INTEGER
INTEGER_ARRAY
- Return type:
- Returns:
A Formula object representing the constructed datetime. If the inputs do not form a valid date/time, the formula will evaluate to an error.
Supported types:
DATETIME
DATETIME_ARRAY
- Raises:
ValueError – If any input is not numeric or an array of numeric values.