makebigdatetime()

Scalar. Constructs a bigdatetime from the given values.

Syntax

makebigdatetime ( year, month, day, hour, minute, second, microsecond [ ,timezone ] )

Parameters

year

An expression that evaluates to a value from 0001 to 9999. Values outside of the range 1970 to 2099 may result in inaccuracies due to leap years and daylight savings time.

month

An expression that evaluates to a value specifying the month. 0-12 indicate January to December, with both 0 and 1 representing January. Values larger than 12 roll over into subsequent years, while negative values subtract months from January of the specified year.

day

An expression that evaluates to a value specifying the day of the month. 0 and 1 both represent the first day of the year. Values larger than the valid number of days for the specified month roll over into subsequent months, while negative values subtract days from the first day of the specified month.

hour

An expression that evaluates to a value specifying the hour of the day. Values larger than 23 roll over into subsequent days, while negative values subtract hours from midnight of the specified day.

minute

An expression that evaluates to a value specifying the minute. Values larger than 59 roll over into subsequent hours, while negative values subtract minutes from the specified hour.

second

An expression that evaluates to a value specifying the second. Values larger than 59 roll over into subsequent minutes, while negative values subtract seconds from the specified minute.

microsecond

An expression that evaluates to a value specifying the microsecond. Values larger than 999999 roll over into subsequent seconds, while negative values subtract microseconds from the specified second.

timezone

(Optional) A string representing the time zone. If omitted, the engine assumes the local time zone. See "Time Zones" and "List of Time Zones" for more information about valid time zone strings.

Usage

Constructs a bigdatetime from the given values. The function takes integer values as its arguments (with the exception of the optional string representing a time zone), and the function returns an bigdatetime. If any argument is NULL, the function returns NULL.

Example

to_string (makebigdatetime (2010, 3, 3, 12, 34, 34, 59111)) returns '2010-03-03 12:34:34:059111'.