Archives of the TeradataForum
Message Posted: Mon, 06 Apr 2009 @ 22:59:48 GMT
Subj: | | Re: CURRENT_TIMESTAMP not UTC |
|
From: | | Anomy Anom |
<-- Anonymously Posted: Monday, April 06, 2009 6:56 PM -->
I don't know if it's the best way - but we use a C function to do the conversion from GMT to local time.
It copies the incoming timestamp to a tm structure, sets the TZ environment variable to GMT, and calls mktime to convert it to a time_t.
Then it sets the TZ back to the local timezone, and calls localtime_r to convert to localtime. The result is then copied to the output
parameter and returned.
Seems to work, but if anyone has any cleaner (native SQL would be nice), please share.
|