MAKETIMESTAMP()

Scalar. Constructs a timestamp.

Syntax

MAKETIMESTAMP( 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

A string representing the time zone. If omitted, assumes the local time zone. See "Sybase CEP Time Zone Database" in the Sybase CEP Integration Guide for more information about valid time zone strings.

Data Types

Return

year

month

day

hour

minute

second

microsecond

timezone

Timestamp

Integer

Integer

Integer

Integer

Integer

Integer

Integer

String

Usage

If any argument is Null, the function returns Null.

Example

INSERT INTO OutStream
SELECT MAKETIMESTAMP(2007,5,15,14,30,0,0)
FROM InStream;