Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 6A1C8478B9A for ; Fri, 21 Jun 2002 14:40:28 -0400 (EDT) Received: from stubee.d2hosting.net (d2hosting.net [66.70.41.160]) by postgresql.org (Postfix) with ESMTP id 060CB478D94 for ; Fri, 21 Jun 2002 13:45:23 -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 g5LHjLS16294; Fri, 21 Jun 2002 12: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 g5LHjIS26579; Fri, 21 Jun 2002 12:45:19 -0500 Message-ID: <3D13662D.4000803@idigx.com> Date: Fri, 21 Jun 2002 12:45:17 -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/20020620 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> Content-Type: multipart/alternative; boundary="------------010900060100050106090203" X-Archive-Number: 200206/181 X-Sequence-Number: 4615 --------------010900060100050106090203 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Tom Lane wrote: >Felipe Nascimento writes: > > >>let's imagine that my server resides in Time Zone(TZ) "-00", and one user >>resides in TZ "-05". Let=B4s say that 12p.m. to the user is 3p.m. to the >>server, on the same day. >> >> > > > >>Let's say that the user inputs a date for a business meeting: "2002-06-20 >>12:00:00". The server will save "2002-06-20 12:00:00-00"?? >> >> > >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. > >This all works exactly the same as ordinary Unix timekeeping --- in >essence, everything is GMT inside the system, and rotation into a >particular timezone happens on-the-fly when a timestamp value is >entered or displayed. The TimeZone variable corresponds to the TZ >environment variable of Unix. > Another option is to get the timestamp via conversion to abstime to integer and your script or application format that timestamp (integer) to local format (string). mytime::abstime::integer (this should be a GMT timestamp [int] if I remember correctly). Someone correct me if I'm wrong. > > > >>My question is: how to manage this so I can send the email to the user at >>his 11 o'clock (8 a.m. server time)???=20 >> >> > >If you let the system do what it wants to do, it will do the right >thing. > > regards, tom lane > >---------------------------(end of broadcast)--------------------------- >TIP 6: Have you searched our list archives? > >http://archives.postgresql.org > > --------------010900060100050106090203 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Tom Lane wrote:
Felipe Nascimento <Felipe.Nascimento@multivalor.com.br> writes:
  
let's imagine that my server resides in Time Zone(TZ) "-00", and one user
resides in TZ "-05". Let=B4s say that 12p.m. to the user is 3p.m. to the
server, on the same day.
    

  
Let's say that the user inputs a date for a business meeting: "2002-06-20
12:00:00". The server will save "2002-06-20 12:00:00-00"??
    

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.

This all works exactly the same as ordinary Unix timekeeping --- in
essence, everything is GMT inside the system, and rotation into a
particular timezone happens on-the-fly when a timestamp value is
entered or displayed.  The TimeZone variable corresponds to the TZ
environment variable of Unix.
Another option is to get the timestamp via conversion to abstime to integer and your script or application format that timestamp (integer) to local format (string).
mytime::abstime::integer (this should be a GMT timestamp [int] if I remember correctly).

Someone correct me if I'm wrong.

  
My question is: how to manage this so I can send the email to the user at
his 11 o'clock (8 a.m. server time)???=20
    

If you let the system do what it wants to do, it will do the right
thing.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org
  


--------------010900060100050106090203--