Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id C6FE1478A81 for ; Fri, 21 Jun 2002 19:06:05 -0400 (EDT) Received: from stubee.d2hosting.net (d2hosting.net [66.70.41.160]) by postgresql.org (Postfix) with ESMTP id 98558477713 for ; Fri, 21 Jun 2002 17:45:20 -0400 (EDT) Received: from firewall.oxford.d2interactive.com (firewall.oxford.d2interactive.com [68.16.167.2]) by stubee.d2hosting.net (8.11.6/linuxconf) with ESMTP id g5LLjMS28173; Fri, 21 Jun 2002 16:45:22 -0500 Received: from idigx.com (host128.oxford.d2interactive.com [192.168.0.128]) by firewall.oxford.d2interactive.com (8.11.6/linuxconf) with ESMTP id g5LLjHS27025; Fri, 21 Jun 2002 16:45:19 -0500 Message-ID: <3D139E6C.3070902@idigx.com> Date: Fri, 21 Jun 2002 16:45:16 -0500 From: Thomas Swan Reply-To: tswan@idigx.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.1a+) Gecko/20020621 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Tom Lane Cc: Felipe Nascimento , pgsql-admin@postgresql.org Subject: Re: time stamp References: <19877.1024672442@sss.pgh.pa.us> <3D13662D.4000803@idigx.com> <28945.1024695343@sss.pgh.pa.us> Content-Type: multipart/alternative; boundary="------------050509080604010901010702" X-Archive-Number: 200206/186 X-Sequence-Number: 4620 --------------050509080604010901010702 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Tom Lane wrote: >Thomas Swan writes: > > >>>No, it won't. If the user has TimeZone set to -05, as he should, then >>>his input of '2002-06-20 12:00:00' will be read as '2002-06-20 12:00:00-05'. >>>And it will be displayed to him that way. But if someone else who >>>has TimeZone set differently looks at the stored value, it will be shown >>>to them properly converted into their timezone. >>> >>> >>> >>This can be a problem if the client is a web application in a fixed >>timezone and the person viewing the results is in a different time zone. >> >> > >If the webserver sets its session TimeZone according to the end user's >preference, everything will work just fine. I am not sure how you >expect Postgres to intuit the proper timezone to use in this scenario >without any cooperation from the webserver... > > regards, tom lane > > I don't expect it to be a postgres problem. What I was referring to was the ability to design the software [not Postgres] to use the integer format of the timestamp field. This way you don't have to know the local timezone of the server where the postgres client [in this case a PHP script called inside Apache] is. Thus is if my the end user sets their timezone to be PST [through some preferences], then when I spit a formatted date string to them I can do the appropriate adjustments in my code [client] and present it according to their locale. It's not the prettiest of solutions, but I found that it work with my situtation and thought it might help the person who was having the problems. I don't see it as a fault of postgresql, never have. If date transforms are needed that can be done just as effectively away from the database and the client database connectivity library. --------------050509080604010901010702 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Lane wrote:
Thomas Swan <tswan@idigx.com> writes:
  
No, it won't.  If the user has TimeZone set to -05, as he should, then
his input of '2002-06-20 12:00:00' will be read as '2002-06-20 12:00:00-05'.
And it will be displayed to him that way.  But if someone else who
has TimeZone set differently looks at the stored value, it will be shown
to them properly converted into their timezone.

      
This can be a problem if the client is a web application in a fixed 
timezone and the person viewing the results is in a different time zone.
    

If the webserver sets its session TimeZone according to the end user's
preference, everything will work just fine.  I am not sure how you
expect Postgres to intuit the proper timezone to use in this scenario
without any cooperation from the webserver...

			regards, tom lane
  
I don't expect it to be a postgres problem.  What I was referring to was the ability to design the software [not Postgres] to use the integer format of the timestamp field.  This way you don't have to know the local timezone of the server where the postgres client [in this case a PHP script called inside Apache] is.    Thus is if my the end user sets their timezone to be PST [through some preferences], then when I spit a formatted date string to them I can do the appropriate adjustments in my code [client] and present it according to their locale.   It's not the prettiest of solutions, but I found that it work with my situtation and thought it might help the person who was having the problems.   I don't see it as a fault of postgresql, never have.   If date transforms are needed that can be done just as effectively away from the database and the client database connectivity library.


--------------050509080604010901010702--