The offsetTime() function

Applies an offset to a Netezza Performance Server Time value. If nzTime with offset crosses 23:59:59.999999, the value resets (wraps) back to zero. For example, applying "+120 minutes" to the encoded equivalent of "23:00:00" returns the encoded equivalent of "01:00:00".

Description

The function has the following syntax:
inline int64 offsetTime(int64 nzTime, int32 sqlOffset, bool* errorFlag 
= NULL)

nzTime specifies the Time value that you want to offset.

sqlOffset specifies the time that is offset, in minutes, in the range of SQL_OFFSET_MIN to SQL_OFFSET_MAX inclusive.

errorFlag is an optional argument. If not NULL, it is set to true if isValidSqlOffset(sqlOffset) is false or isValidTime(nzTime) is false. Otherwise, it is set to false.

Returns

t= (nzTime + sqlOffset*60*1,000,000) mod (ENC_TIME_MAX+1) if *errorFlag is NULL and an exception is not thrown or if *errorFlag is not NULL and, after the call, *errorFlag is false.

Otherwise, the function returns an indeterminate value.

Throws

The function throws an opaque exception object if errorFlag is NULL and (isValidSqlOffset(sqlOffset) is false or isValidTime(nzTime) is false).