DATETIMEFROMPARTS Function

Returns a string formatted like "2015-12-25 06:54:47.152" based on the provided date and time values.

Syntax

DATETIMEFROMPARTS(year, month, day, hour, minute, second, millisecond)

Parameters

Return Value

A date/time string formatted like "2015-01-02 05:45:30.123".

Example

-- Prints "2015-01-02 05:45:30.123".
PRINT DATETIMEFROMPARTS(2015, 1, 2, 5, 45, 30, 123)