Re: sysdate, Time Zones and GMT

From: DRathbun <drathbun_at_aol.com>
Date: 1995/06/20
Message-ID: <3s81cn$bvu_at_newsbf02.news.aol.com>#1/1


In article <3s4n4b$ol6_at_engnews2.Eng.Sun.COM>, drolfe_at_Eng.Sun.COM (David Rolfe) writes:

>In article 15955_at_newton.ccs.tuns.ca, James Richard writes:
>> In article <803213757snx_at_johnw.supreme.auug.org.au>
 johnw_at_canb.auug.org.au
 writes:
>> >I need to be able to store date/time information in an Oracle v7
 database
 in
>> >GMT (Grenich Mean Time) also known as UTC.
>> >

 <snip>
>V7.1 allows you to write your own functions. You could write one called
>
>Super_New_Time(d, z1, z2) /* Input datetime, from time zone, to time
 zone */
>
>When/If Oracle supports non-us Time Zones you can then globally change
 the
>function name to New_Time from Super_New_Time in your code.
>
>Your function could use a table in the format
>
>TZ_NAME varchar2(3) NOT NULL /* Time zone name, Primary key */
>TZ_DELTA number(2) NOT NULL /* Offset from GMT, between -23.5 and +23.5
 */
>
>to figure out the difference between the two zones.
>
 <snip>
>
>David Rolfe,
>SunSoft,
>Mountain View,
>California.
>
>

Someone suggested earlier that setting the system time to GMT would be the cleanest solution. I may be a little out of my normal area here, but under UNIX isn't that the standard anyway? There is usually a timezone environment variable (TZ) that is set in a users login script (.profile, for example). I experimented a bit and setting the TZ variable to a different time zone _did_ change the result for a

select to_char(sysdate, 'HH24:MI:SS') from dual

statement. Setting all users TZ=GMT seems like it would work. Again, that is only available on a UNIX platform, and may not work the same on all UNIX systems either. Just trying to be helpful!

Regards,

Dave Rathbun
Integra Solutions
Dallas, TX
DRathbun_at_AOL.com Received on Tue Jun 20 1995 - 00:00:00 CEST

Original text of this message