Re: Question regard dates in Oracle database.
Date: 1996/03/28
Message-ID: <4jcvf6$14s_at_inet-nntp-gw-1.us.oracle.com>#1/1
cfischer_at_nando.net (Chris Fischer) wrote:
>tkyte_at_us.oracle.com (Thomas J Kyte) wrote:
[snip]
>But Tom, your scenario assumes that the application is using the
>CLIENT time to post transactions. For the very reasons you indicate
>we ALWAYS use the server time. The way we handle clients in different
>time zones is as follows:
My scenario inherited from the original posters scenario. He wanted the client to decide the timezone and gave a scenario as to why this should be. I gave a counter one to show why this should not be.
>We set the database server time to the correct local time for the tz
>its located in. For each client, we know what time zone they are in.
Do you? or does the client set it up. I had a problem with our email package once. It assumed the client pc would set the TZ environment variable. I don't always read the install notes carefully. I didn't set this variable. It defaults to GMT. Our email can be sent in a deferred mode (eg: send this mail at midnight, not right now). It does this by mucking with the timestamp field. Since my dates where being posted in GMT, none of my mail was being delivered for 5 hours after I sent it. Simply by me setting an environment variable, I could change the way my email package viewed my transaction and there was nothing it could do about it, period.
>We post all transactions to the database using the server time. When
>I'm in say, Los Angeles and ask for all transactions I posted between
>9am and 11am, we use the knowlege of the time zone they are in to ask
>for all transactions on the server (Eastern Time) that occurred
>between 12noon and 2pm. We adjust the time of the transactions as
>they are displayed to the clients.
>
>Phew, now I'm exhausted!
Do you know about new_time? It could relieve a lot of that exhaustion.
NEW_TIME Syntax NEW_TIME(d,z1,z2)
Purpose Returns the date and time in time zone z2 when date and time in time zone z1 are d. The arguments z1 and z2 can be any of these text strings:
[strings omitted]
>
>+------------------------------------------------------------+
>| Chris Fischer cfischer_at_nando.net |
>| Sr. Systems Analyst Work: (919)676-0062 |
>| Toys "R" Us |
>+------------------------------------------------------------+
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
opinions and statements are mine and do not necessarily reflect the opinions of Oracle Corporation. Received on Thu Mar 28 1996 - 00:00:00 CET
