Support for time_t temporal structures

The API provides functions for working with the C++ time_t structure. Implementations of time_t differ on various systems; the IBM® Netezza® implementation uses the signed int32 implementation. This is the implementation that is used by the gcc 3.4.5 and the diab compilers, which are used by Netezza for UDX compilation. This implementation does have a limitation, namely that it supports dates only between 1/1/1970 and 1/19/2038, which means values from 0 to 2147483647, inclusive. Although the time_t structure standard supports values outside that range, the behavior of those other values is not guaranteed. The remaining sections of this document refer to this specific implementation as "time_t".

The data type helper API supports only decoding and encoding between time_t and the Netezza Date and Timestamp data types. Since the range of time_t is a subset of the range for Netezza Date and Timestamp, this conversion allows for only values in the range of time_t. The following table lists several correlated values between time_t, Netezza Date and Netezza Timestamp. Using the API functions to encode or decode Date or Timestamp values out of the range of time_t results in errors.

Table 1. Examples of time_t and Netezza Date and Timestamp conversions
Gregorian calendar date and time time_t value at UTC + 0:00 (GMT) NZ Date value NZ Timestamp value
Lowest supported NZ date: 1/1/0001, 00:00:00 UNDEFINED -730,119 -63,082,281,600,000,000
time_t Epoch start: 1/1/1970, 00:00:00 0 -10,957 -946,684,800,000,000
NZ day zero: 1/1/2000, 00:00:00 946,684,800 0 0
time_t Epoch end: 1/19/2038, 03:14:07 2,147,483,647 13,898 1,200,798,847,000,000
Highest supported NZ date: 12/31/9999, 11:59:59.999999 UNDEFINED 2,921,939 252,455,615,999,999,999