Time zone support

The SPU automatically has its time zone set to that of the host. The time zone is reset each time a new snippet runs on the SPU, which helps to ensure that the UDX operates in a consistent environment regardless of where it is running. The reset also helps to clear any time zone settings that might have been made by a UDX in a previous snippet.

The following time zone-related variables can be used normally:
extern char *tzname[2];
extern long timezone;
extern int daylight;
The following time functions can be used normally:
extern "C" time_t mktime(struct tm *);
extern "C" char *ctime(const time_t *);
extern "C" char *ctime_r(const time_t *, char *);
extern "C" struct tm *localtime(const time_t *);
extern "C" struct tm *localtime_r(const time_t *, struct tm *);
extern "C" size_t strftime(char *, size_t, const char *, const struct
           tm *);
extern "C" void tzset();

If your UDF or UDA uses a function such as strftime (which formats a local time/date according to LC_* locale settings), keep in mind the best practices from the previous section, C runtime library functions. Though the function returns a value on the host, results are inconsistent on the SPUs because the SPUs do not support the LC* variables. The value that is returned on the host is based on the LC_TIME value when the Netezza Performance Server system was started, which can cause some unexpected time settings for the UDX code. Avoid the use of LC* variables or functions that use them.