The encodeTimestamp (struct tm Input Format) function

Converts a struct tm value to a Netezza Performance Server-encoded Timestamp. The function uses only the tm.tm_year, tm.tm_day, tm.tm_mon, tm.tm_hour, tm.tm_min and tm.tm_sec fields of the ts structure, and ignores the rest. The ts structure must pass the isValidTimeStruct() boolean test. The function also adds zero microseconds to the encoded value.

Description

The function has the following syntax:
inline void encodeTimestamp(const struct tm& ts, int64* 
encodedTimestamp, bool* errorFlag = NULL)

ts specifies the struct tm Timestamp value.

encodedTimestamp specifies the parameter in which to record the Timestamp that is encoded in Netezza Performance Server format.

errorFlag is an optional argument. If not NULL, it is set to true if isValidTimeStruct(ts) is false. Otherwise, it is set to false.

Throws

The function throws an opaque exception object if &ts is NULL or encodedTimestamp is NULL or (errorFlag is NULL and isValidTimeStruct(ts) is false).