The encodeDate (time_t Values) function

The encodeDate() function converts a time_t Date value to a Netezza Performance Server-encoded Date. The function drops the hours, minutes, and seconds elapsed after the last whole day in the time_t value to round the time_t value down to the last whole day.

Description

The function has the following syntax:
inline void encodeDate(int32 date, int32* encodedDate, bool* errorFlag 
= NULL)

date specifies the time_t date value.

encodedDate specifies the parameter in which to record the Date that is encoded in Netezza Performance Server format.

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

Throws

The function throws an opaque exception object if encodedDate is NULL or (errorFlag is NULL and isValidEpoch(date) is false).