From nimeshb@syscon-intl.com Wed Jun 19 22:51:58 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 7EDC447699B for ; Wed, 19 Jun 2002 18:51:58 -0400 (EDT) Received: from gargoyle2.syscon-intl.com (ns.syscon-intl.com [63.237.63.226]) by postgresql.org (Postfix) with ESMTP id BEFEE475B9D for ; Wed, 19 Jun 2002 18:28:28 -0400 (EDT) Received: from smtp.syscon-intl.com (smtp.syscon-intl.com [172.17.0.2]) by gargoyle2.syscon-intl.com (8.9.3/8.9.3) with ESMTP id RAA10502 for ; Wed, 19 Jun 2002 17:28:29 -0500 Received: from nimeshb (nimeshb.syscon-intl.com) by smtp.syscon-intl.com (8.8.5/8.8.5) with SMTP id RAA29096 for ; Wed, 19 Jun 2002 17:28:29 -0500 Message-ID: <001e01c217e0$a898e220$110a11ac@sysconintl.com> From: "nimeshb" To: Subject: time stamp Date: Wed, 19 Jun 2002 17:28:38 -0500 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001B_01C217B6.BF907F80" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200206/149 X-Sequence-Number: 4583 This is a multi-part message in MIME format. ------=_NextPart_000_001B_01C217B6.BF907F80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable The datatype "timestamp" automatically adds zone in the field values. i.e. If you insert a value 06-05-2002 15:03:08 (MM/DD/YYYY HH/MM/SS) it wou= ld store as "06-05-2002 15:03:08-05". I don't want last two digits 05 which represents timezone and determines how many hrs yo= u are ahead(or behind?) GMT. Is there anyway to get rid of these digits(representing Zone) Nimesh ------=_NextPart_000_001B_01C217B6.BF907F80 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
The datatype "timestamp" automatically add= s zone in=20 the field values.
i.e. If you insert a value 06-05-2002 15:0= 3:08=20 (MM/DD/YYYY HH/MM/SS) it would store as "06-05-2002 15:03:08-05". I don't= =20 want
last two digits 05 which represents timezo= ne and=20 determines how many hrs you are ahead(or behind?) GMT.
Is there anyway to get rid of these=20 digits(representing Zone)
Nimesh
 
------=_NextPart_000_001B_01C217B6.BF907F80-- From bmccane@mccons.net Wed Jun 19 23:41:12 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 18868475DD2 for ; Wed, 19 Jun 2002 19:41:12 -0400 (EDT) Received: from fw.mccons.net (adsl-65-64-105-41.dsl.kscymo.swbell.net [65.64.105.41]) by postgresql.org (Postfix) with ESMTP id 99615475DF1 for ; Wed, 19 Jun 2002 19:32:07 -0400 (EDT) Received: (from root@localhost) by fw.mccons.net (8.11.3/8.11.4) id g5JNW9V33245; Wed, 19 Jun 2002 18:32:09 -0500 (CDT) (envelope-from bmccane@mccons.net) Received: from localhost (localhost [127.0.0.1]) by fw.mccons.net (8.11.3/8.11.4av) with ESMTP id g5JNW4w33236; Wed, 19 Jun 2002 18:32:04 -0500 (CDT) (envelope-from bmccane@mccons.net) Date: Wed, 19 Jun 2002 18:32:04 -0500 (CDT) From: Brian McCane To: nimeshb Cc: Subject: Re: time stamp In-Reply-To: <001e01c217e0$a898e220$110a11ac@sysconintl.com> Message-ID: <20020619183144.B2042-100000@fw.mccons.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by AMaViS perl-11 X-Razor-Spam-ID: dfc058ce2c8589df3390fe24521826b9eba9cf1d X-Archive-Number: 200206/151 X-Sequence-Number: 4585 CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; On Wed, 19 Jun 2002, nimeshb wrote: > The datatype "timestamp" automatically adds zone in the field values. > i.e. If you insert a value 06-05-2002 15:03:08 (MM/DD/YYYY HH/MM/SS) it would store as "06-05-2002 15:03:08-05". I don't want > last two digits 05 which represents timezone and determines how many hrs you are ahead(or behind?) GMT. > Is there anyway to get rid of these digits(representing Zone) > Nimesh > > Wm. Brian McCane | Life is full of doors that won't open Search http://recall.maxbaud.net/ | when you knock, equally spaced amid those Usenet http://freenews.maxbaud.net/ | that open when you don't want them to. Auction http://www.sellit-here.com/ | - Roger Zelazny "Blood of Amber" From nimeshb@syscon-intl.com Thu Jun 20 14:50:33 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0D212476B79 for ; Thu, 20 Jun 2002 10:50:33 -0400 (EDT) Received: from gargoyle2.syscon-intl.com (ns.syscon-intl.com [63.237.63.226]) by postgresql.org (Postfix) with ESMTP id 8E5834766F7 for ; Thu, 20 Jun 2002 10:30:43 -0400 (EDT) Received: from smtp.syscon-intl.com (smtp.syscon-intl.com [172.17.0.2]) by gargoyle2.syscon-intl.com (8.9.3/8.9.3) with ESMTP id JAA23555; Thu, 20 Jun 2002 09:30:45 -0500 Received: from nimeshb (nimeshb.syscon-intl.com) by smtp.syscon-intl.com (8.8.5/8.8.5) with SMTP id JAA02802; Thu, 20 Jun 2002 09:30:45 -0500 Message-ID: <001301c21867$1814a720$110a11ac@sysconintl.com> From: "nimeshb" To: "Brian McCane" Cc: References: <20020619183144.B2042-100000@fw.mccons.net> Subject: Re: time stamp Date: Thu, 20 Jun 2002 09:30:57 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200206/154 X-Sequence-Number: 4588 CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work. It creates that table but when you insert a value without time zone it stll appends -05 as time zone(my datestyle is US and since my time is EST it appends 05 on its own and that sucks ) ----- Original Message ----- From: "Brian McCane" To: "nimeshb" Cc: Sent: Wednesday, June 19, 2002 6:32 PM Subject: Re: [ADMIN] time stamp > > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; > > > On Wed, 19 Jun 2002, nimeshb wrote: > > > The datatype "timestamp" automatically adds zone in the field values. > > i.e. If you insert a value 06-05-2002 15:03:08 (MM/DD/YYYY HH/MM/SS) it would store as "06-05-2002 15:03:08-05". I don't want > > last two digits 05 which represents timezone and determines how many hrs you are ahead(or behind?) GMT. > > Is there anyway to get rid of these digits(representing Zone) > > Nimesh > > > > > > Wm. Brian McCane | Life is full of doors that won't open > Search http://recall.maxbaud.net/ | when you knock, equally spaced amid those > Usenet http://freenews.maxbaud.net/ | that open when you don't want them to. > Auction http://www.sellit-here.com/ | - Roger Zelazny "Blood of Amber" > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > From marklists@mceahern.com Thu Jun 20 15:57:48 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 0A56F476718 for ; Thu, 20 Jun 2002 11:57:48 -0400 (EDT) Received: from mceahern.com (unknown [216.26.162.8]) by postgresql.org (Postfix) with ESMTP id 21295476617 for ; Thu, 20 Jun 2002 11:55:17 -0400 (EDT) Received: from LAPMARK [64.109.30.40] by mceahern.com with ESMTP (SMTPD32-7.10) id AACDB28010A; Thu, 20 Jun 2002 11:54:53 -0400 From: "Mark McEahern" To: "nimeshb" , "Brian McCane" Cc: Subject: Re: time stamp Date: Thu, 20 Jun 2002 10:54:46 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: <001301c21867$1814a720$110a11ac@sysconintl.com> Importance: Normal X-Archive-Number: 200206/155 X-Sequence-Number: 4589 > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work. It > creates that table but > when you insert a value without time zone it stll appends -05 as time > zone(my datestyle is US and since my time is EST it appends 05 on its own > and that sucks ) Why do you care how pg stores the field? Are you able to retrieve it and do the stuff you need to do? // m - From nimeshb@syscon-intl.com Thu Jun 20 16:07:47 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 60C30476A8A for ; Thu, 20 Jun 2002 12:07:47 -0400 (EDT) Received: from gargoyle2.syscon-intl.com (ns.syscon-intl.com [63.237.63.226]) by postgresql.org (Postfix) with ESMTP id A5D4D476B38 for ; Thu, 20 Jun 2002 12:07:10 -0400 (EDT) Received: from smtp.syscon-intl.com (smtp.syscon-intl.com [172.17.0.2]) by gargoyle2.syscon-intl.com (8.9.3/8.9.3) with ESMTP id LAA25730; Thu, 20 Jun 2002 11:07:13 -0500 Received: from nimeshb (nimeshb.syscon-intl.com) by smtp.syscon-intl.com (8.8.5/8.8.5) with SMTP id LAA03735; Thu, 20 Jun 2002 11:07:12 -0500 Message-ID: <002701c21874$924a21c0$110a11ac@sysconintl.com> From: "nimeshb" To: "Mark McEahern" , "Brian McCane" Cc: References: Subject: Re: time stamp Date: Thu, 20 Jun 2002 11:07:26 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Archive-Number: 200206/156 X-Sequence-Number: 4590 I am migrating our database from ingres to postgres and I want a replica of ingres database into postgres for this I had to write a lot of scripts but I don't know how to take care of this problem as postgres this by default.When I retrieve it with a select query it comes with ZONE but you are right may be the programmers would be able to do whatever they want without any problem.Thanks anyway ! Nimesh ----- Original Message ----- From: "Mark McEahern" To: "nimeshb" ; "Brian McCane" Cc: Sent: Thursday, June 20, 2002 10:54 AM Subject: Re: [ADMIN] time stamp > > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work. It > > creates that table but > > when you insert a value without time zone it stll appends -05 as time > > zone(my datestyle is US and since my time is EST it appends 05 on its own > > and that sucks ) > > Why do you care how pg stores the field? Are you able to retrieve it and do > the stuff you need to do? > > // m > > - > > > ---------------------------(end of broadcast)--------------------------- > TIP 5: Have you checked our extensive FAQ? > > http://www.postgresql.org/users-lounge/docs/faq.html > From tgl@sss.pgh.pa.us Thu Jun 20 16:58:36 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 9E022476B19 for ; Thu, 20 Jun 2002 12:58:36 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 66005476D61 for ; Thu, 20 Jun 2002 12:48:58 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5KGmb112751; Thu, 20 Jun 2002 12:48:37 -0400 (EDT) To: "nimeshb" Cc: "Brian McCane" , pgsql-admin@postgresql.org Subject: Re: time stamp In-reply-to: <001301c21867$1814a720$110a11ac@sysconintl.com> References: <20020619183144.B2042-100000@fw.mccons.net> <001301c21867$1814a720$110a11ac@sysconintl.com> Comments: In-reply-to "nimeshb" message dated "Thu, 20 Jun 2002 09:30:57 -0500" Date: Thu, 20 Jun 2002 12:48:37 -0400 Message-ID: <12748.1024591717@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200206/157 X-Sequence-Number: 4591 "nimeshb" writes: > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work. Oh? I get test72=# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; CREATE test72=# insert into test values(now()); INSERT 803798 1 test72=# insert into test values('2002-02-22 12:34:56'); INSERT 803799 1 test72=# select * from test; ts ---------------------------- 2002-06-20 12:46:47.030269 2002-02-22 12:34:56 (2 rows) test72=# select version(); version --------------------------------------------------------------- PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3 (1 row) regards, tom lane From Felipe.Nascimento@multivalor.com.br Thu Jun 20 19:01:57 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BBF6D476E62 for ; Thu, 20 Jun 2002 15:01:57 -0400 (EDT) Received: from mail.multivalor.com.br (mail.multivalor.com.br [200.197.208.35]) by postgresql.org (Postfix) with ESMTP id 1B636476D76 for ; Thu, 20 Jun 2002 14:31:45 -0400 (EDT) Received: from mvescexc01.esc.multivalor.com.br (mvescexc01.esc.multivalor.com.br [192.168.130.66]) by mail.multivalor.com.br (8.11.6/8.9.3) with ESMTP id g5KIVfn05435 for ; Thu, 20 Jun 2002 15:31:41 -0300 Received: by mvescexc01.esc.multivalor.com.br with Internet Mail Service (5.5.2653.19) id ; Thu, 20 Jun 2002 15:31:41 -0300 Message-ID: From: Felipe Nascimento To: pgsql-admin@postgresql.org Subject: Re: time stamp Date: Thu, 20 Jun 2002 15:31:39 -0300 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C21888.B76F2A90" X-Archive-Number: 200206/158 X-Sequence-Number: 4592 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C21888.B76F2A90 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I used to manage a database without Time Zone. Now I use PG, and this concept of using Time Zone in date data is new to me. I find it intersting, but I have the following doubt: 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"?? If my application sends an e-mail for the user reminding him of the meeting one hour befor it, the server will send that email at 11 o'clock (server time) that is 2 o'clock to the user, that means, after the meeting. 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)??? Tks Felipe Nascimento -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: quinta-feira, 20 de junho de 2002 13:49 To: nimeshb Cc: Brian McCane; pgsql-admin@postgresql.org Subject: Re: [ADMIN] time stamp=20 "nimeshb" writes: > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work. Oh? I get test72=3D# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; CREATE test72=3D# insert into test values(now()); INSERT 803798 1 test72=3D# insert into test values('2002-02-22 12:34:56'); INSERT 803799 1 test72=3D# select * from test; ts=20=20=20=20=20=20=20=20=20=20=20=20=20 ---------------------------- 2002-06-20 12:46:47.030269 2002-02-22 12:34:56 (2 rows) test72=3D# select version(); version=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 --------------------------------------------------------------- PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3 (1 row) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly ------_=_NextPart_001_01C21888.B76F2A90 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: [ADMIN] time stamp

I used to manage a database without Time Zone. Now I use = PG, and this concept of using Time Zone in date data is new to me. I find i= t intersting, but I have the following doubt:

let's imagine that my server resides in Time Zone(TZ) &qu= ot;-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 meet= ing: "2002-06-20 12:00:00". The server will save "2002-06-20= 12:00:00-00"?? If my application sends an e-mail for the user remindi= ng him of the meeting one hour befor it, the server will send that email at= 11 o'clock (server time) that is 2 o'clock to the user, that means, after = the meeting.

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

Tks
Felipe Nascimento


-----Original Message-----
From: Tom Lane [mai= lto:tgl@sss.pgh.pa.us]
Sent: quinta-feira, 20 de junho de 2002 13:49
To: nimeshb
Cc: Brian McCane; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] time stamp


"nimeshb" <nimeshb@syscon-intl.com> write= s:
> CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) = ; doesn't work.

Oh?  I get

test72=3D# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME Z= ONE) ;
CREATE
test72=3D# insert into test values(now());
INSERT 803798 1
test72=3D# insert into test values('2002-02-22 12:34:56'= );
INSERT 803799 1
test72=3D# select * from test;
         &n= bsp;   ts         &n= bsp;  
----------------------------
 2002-06-20 12:46:47.030269
 2002-02-22 12:34:56
(2 rows)

test72=3D# select version();
         &n= bsp;            = ;      version      =             &nb= sp;        
--------------------------------------------------------= -------
 PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by= GCC 2.95.3
(1 row)


             = ;           reg= ards, tom lane

---------------------------(end of broadcast)------------= ---------------
TIP 3: if posting/reading through Usenet, please send an= appropriate
subscribe-nomail command to majordomo@postgresql.org so = that your
message can get through to the mailing list cleanly

------_=_NextPart_001_01C21888.B76F2A90-- From marklists@mceahern.com Thu Jun 20 22:26:40 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 741E647653A for ; Thu, 20 Jun 2002 18:26:40 -0400 (EDT) Received: from mceahern.com (unknown [216.26.162.8]) by postgresql.org (Postfix) with ESMTP id 94068475C5D for ; Thu, 20 Jun 2002 17:37:34 -0400 (EDT) Received: from LAPMARK [64.109.30.40] by mceahern.com with ESMTP (SMTPD32-7.10) id AB1CDBC0030; Thu, 20 Jun 2002 17:37:32 -0400 From: "Mark McEahern" To: Subject: Re: time stamp Date: Thu, 20 Jun 2002 16:37:18 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 In-Reply-To: Importance: Normal X-Archive-Number: 200206/160 X-Sequence-Number: 4594 To be fair, you really ought to ask this question: Suppose user A sets up a conference call with users B, C, and D, who each live in: A: Tokyo B: Denver C: San Diego D: New York The meeting is to occur at 1:00 PM tokyo time. (Never mind for now whether that makes any sense.) Trick questions: 1. How does the database store the time of the meeting? 2. What if user D is traveling to London at the time of the meeting? She changes her locale on her computer to London time, will the database show her the correct time? However you solve this problem, it's not going to be by naively storing user A's local time with no time zone information and leaving it at that. ;-) // m -----Original Message----- From: pgsql-admin-owner@postgresql.org [mailto:pgsql-admin-owner@postgresql.org]On Behalf Of Felipe Nascimento Sent: Thursday, June 20, 2002 1:32 PM To: pgsql-admin@postgresql.org Subject: Re: [ADMIN] time stamp I used to manage a database without Time Zone. Now I use PG, and this concept of using Time Zone in date data is new to me. I find it intersting, but I have the following doubt: let's imagine that my server resides in Time Zone(TZ) "-00", and one user resides in TZ "-05". Letīs 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"?? If my application sends an e-mail for the user reminding him of the meeting one hour befor it, the server will send that email at 11 o'clock (server time) that is 2 o'clock to the user, that means, after the meeting. 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)??? Tks Felipe Nascimento -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: quinta-feira, 20 de junho de 2002 13:49 To: nimeshb Cc: Brian McCane; pgsql-admin@postgresql.org Subject: Re: [ADMIN] time stamp "nimeshb" writes: > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work. Oh? I get test72=# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; CREATE test72=# insert into test values(now()); INSERT 803798 1 test72=# insert into test values('2002-02-22 12:34:56'); INSERT 803799 1 test72=# select * from test; ts ---------------------------- 2002-06-20 12:46:47.030269 2002-02-22 12:34:56 (2 rows) test72=# select version(); version --------------------------------------------------------------- PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3 (1 row) regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly - From aaron@m1group.com.au Fri Jun 21 00:30:14 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 79FE947611C for ; Thu, 20 Jun 2002 20:30:14 -0400 (EDT) Received: from pugsly.m1group.com.au (unknown [144.135.2.168]) by postgresql.org (Postfix) with ESMTP id 672E74774D5 for ; Thu, 20 Jun 2002 19:04:20 -0400 (EDT) Received: from scooby.m1group.com.au ([192.168.100.96]) by pugsly.m1group.com.au (8.11.2/8.11.0) with SMTP id g5KMrb529302; Fri, 21 Jun 2002 06:53:37 +0800 From: Aaron Spiteri Date: Thu, 20 Jun 2002 23:00:49 GMT Message-ID: <20020620.23004900@scooby.m1group.com.au> Subject: Re: time stamp To: Felipe Nascimento , pgsql-admin@postgresql.org In-Reply-To: References: X-Mailer: Mozilla/3.0 (compatible; StarOffice/5.2;Linux) X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary= "------------=_4D4800896764085010A8" Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/161 X-Sequence-Number: 4595 --------------=_4D4800896764085010A8 Content-Description: filename="text1.txt" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Interesting point.=20 Original Message dated 21/06/02, 4:31:39 Author: Felipe Nascimento Re: Re: [ADMIN] time stamp : I used to manage a database without Time Zone. Now I use PG, and this=20 concept of using Time Zone in date data is new to me. I find it=20 intersting, but I have the following doubt: let's imagine that my server resides in Time Zone(TZ) "-00", and one user= =20 resides in TZ "-05". Let=B4s say that 12p.m. to the user is 3p.m. to the=20 server, on the same day. Let's say that the user inputs a date for a business meeting: "2002-06-20= =20 12:00:00". The server will save "2002-06-20 12:00:00-00"?? If my=20 application sends an e-mail for the user reminding him of the meeting one= =20 hour befor it, the server will send that email at 11 o'clock (server=20 time) that is 2 o'clock to the user, that means, after the meeting. My question is: how to manage this so I can send the email to the user at= =20 his 11 o'clock (8 a.m. server time)???=20 Tks=20 Felipe Nascimento=20 -----Original Message-----=20 From: Tom Lane [mailto:tgl@sss.pgh.pa.us]=20 Sent: quinta-feira, 20 de junho de 2002 13:49=20 To: nimeshb=20 Cc: Brian McCane; pgsql-admin@postgresql.org=20 Subject: Re: [ADMIN] time stamp=20 "nimeshb" writes:=20 > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work.=20 Oh? I get=20 test72=3D# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ;=20 CREATE=20 test72=3D# insert into test values(now());=20 INSERT 803798 1=20 test72=3D# insert into test values('2002-02-22 12:34:56');=20 INSERT 803799 1=20 test72=3D# select * from test;=20 ts=20=20=20=20=20=20=20=20=20=20=20=20=20 ----------------------------=20 2002-06-20 12:46:47.030269=20 2002-02-22 12:34:56=20 (2 rows)=20 test72=3D# select version();=20 version=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ---------------------------------------------------------------=20 PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3=20 (1 row)=20 regards, tom lane=20 ---------------------------(end of broadcast)---------------------------=20 TIP 3: if posting/reading through Usenet, please send an appropriate=20 subscribe-nomail command to majordomo@postgresql.org so that your=20 message can get through to the mailing list cleanly=20 --------------=_4D4800896764085010A8 Content-Description: filename="text1.html" Content-Type: text/html Content-Transfer-Encoding: quoted-printable Re: [ADMIN] time stamp

Interesting point.=20


Original Message dated 21/06/02, 4:31:39

Author: Felipe Nascimento <Felipe.Nascimento@multivalor.com.br>

Re: Re: [ADMIN] time stamp :




I used to manage a database without Time Zone. Now I use PG, and this concept of using Time Zone in date data is new to me. I find it intersting, but I have the following doubt:

let's imagine that my server resides in Time Zone(TZ) "-00", and one user resides in TZ "-05". Let´s 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"?? If my application sends an e-mail for the user reminding him of the meeting one hour befor it, the server will send that email at 11 o'clock (server time) that is 2 o'clock to the user, that means, after the meeting.

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

Tks
Felipe Nascimento=20



-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us= ]
Sent: quinta-feira, 20 de junho de 2002 13:49
To: nimeshb
Cc: Brian McCane; pgsql-admin@postgresql.org
Subject: Re: [ADMIN] time stamp



"nimeshb" <nimeshb@syscon-intl.com> writes:
> CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work.=20

Oh?  I get=20

test72=3D# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ;
CREATE
test72= =3D# insert into test values(now());
INSERT 803798 1
test72=3D# insert into test values('2002-02-22 12:34:56');
INSERT 803799 1
test72=3D# select * from test;
     = ;        ts            
----------------------------
 2002-06-20 12:46:47.030269
 2002-02-22 12:34:56
(2 rows)=20

test72=3D# select version();
         &n= bsp;            = ;      version           &n= bsp;            = ;   
-------------------------------------------------= --------------
 PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3
(1 row)=20



             = ;           regards, tom lane=20

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly=20

--------------=_4D4800896764085010A8-- From Felipe.Nascimento@multivalor.com.br Fri Jun 21 14:31:37 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 7F804476F56 for ; Fri, 21 Jun 2002 10:31:37 -0400 (EDT) Received: from mail.multivalor.com.br (mail.multivalor.com.br [200.197.208.35]) by postgresql.org (Postfix) with ESMTP id 37FC1476FF5 for ; Fri, 21 Jun 2002 10:25:52 -0400 (EDT) Received: from mvescexc01.esc.multivalor.com.br (mvescexc01.esc.multivalor.com.br [192.168.130.66]) by mail.multivalor.com.br (8.11.6/8.9.3) with ESMTP id g5LEPtn10100 for ; Fri, 21 Jun 2002 11:25:55 -0300 Received: by mvescexc01.esc.multivalor.com.br with Internet Mail Service (5.5.2653.19) id ; Fri, 21 Jun 2002 11:25:54 -0300 Message-ID: From: Felipe Nascimento To: pgsql-admin@postgresql.org Subject: Re: time stamp Date: Fri, 21 Jun 2002 11:25:52 -0300 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2192F.8C257EA0" X-Archive-Number: 200206/167 X-Sequence-Number: 4601 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2192F.8C257EA0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Anybody??? _____=20=20 I used to manage a database without Time Zone. Now I use PG, and this concept of using Time Zone in date data is new to me. I find it intersting, but I have the following doubt: 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"?? If my application sends an e-mail for the user reminding him of the meeting one hour befor it, the server will send that email at 11 o'clock (server time) that is 2 o'clock to the user, that means, after the meeting. 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 Tks=20 Felipe Nascimento=20 -----Original Message-----=20 From: Tom Lane [ mailto:tgl@sss.pgh.pa.us ]=20 Sent: quinta-feira, 20 de junho de 2002 13:49=20 To: nimeshb=20 Cc: Brian McCane; pgsql-admin@postgresql.org=20 Subject: Re: [ADMIN] time stamp=20 "nimeshb" writes:=20 > CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ; doesn't work.=20 Oh? I get=20 test72=3D# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE) ;=20 CREATE=20 test72=3D# insert into test values(now());=20 INSERT 803798 1=20 test72=3D# insert into test values('2002-02-22 12:34:56');=20 INSERT 803799 1=20 test72=3D# select * from test;=20 ts=20=20=20=20=20=20=20=20=20=20=20=20=20 ----------------------------=20 2002-06-20 12:46:47.030269=20 2002-02-22 12:34:56=20 (2 rows)=20 test72=3D# select version();=20 version=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ---------------------------------------------------------------=20 PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled by GCC 2.95.3=20 (1 row)=20 regards, tom lane=20 ---------------------------(end of broadcast)---------------------------=20 TIP 3: if posting/reading through Usenet, please send an appropriate=20 subscribe-nomail command to majordomo@postgresql.org so that your=20 message can get through to the mailing list cleanly=20 ------_=_NextPart_001_01C2192F.8C257EA0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: [ADMIN] time stamp
Anybody???



I used to manage a database without Time Zone. Now I us= e PG,=20 and this concept of using Time Zone in date data is new to me. I find it= =20 intersting, but I have the following doubt:

let's imagine that my server resides in Time Zone(TZ) "= -00",=20 and one user resides in TZ "-05". Let=B4s say that 12p.m. to the user is = 3p.m.=20 to the server, on the same day.

Let's say that the user inputs a date for a business me= eting:=20 "2002-06-20 12:00:00". The server will save "2002-06-20 12:00:00-00"?? If= my=20 application sends an e-mail for the user reminding him of the meeting one= hour=20 befor it, the server will send that email at 11 o'clock (server time) tha= t is=20 2 o'clock to the user, that means, after the meeting.

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

Tks
Felipe Nascimento =



-----Original Message-----
Fr= om: Tom=20 Lane [mailto:tgl@sss.pgh.pa.us]<= /FONT>=20
Sent: quinta-feira, 20 de junho de 2002 13:49= =20
To: nimeshb
Cc: Brian McCane= ;=20 pgsql-admin@postgresql.org
Subject: Re: [ADMIN]= time=20 stamp



"nimeshb" <nimeshb@syscon-intl.com> writes:=20
> CREATE TABLE test (ts TIMESTAMP WITHOUT TIME ZONE= ) ;=20 doesn't work.

Oh?  I get

test72=3D# CREATE TABLE test (ts TIMESTAMP WITHOUT TIME= ZONE)=20 ;
CREATE
test72=3D# i= nsert into=20 test values(now());
INSERT 803798 1
= test72=3D# insert into test values('2002-02-22 12:34:56');=20
INSERT 803799 1
test72=3D# s= elect *=20 from test;
          &nbs= p; =20 ts            = ;=20

----------------------------
 2002-06-20 12:46:47.030269

 2002-02-22 12:34:56
(2 rows)

test72=3D# select version();
          &nbs= p;            &= nbsp;   =20 version           =             &nb= sp;   =20

---------------------------------------------------------------<= /FONT>=20
 PostgreSQL 7.2.1 on hppa-hp-hpux10.20, compiled = by GCC=20 2.95.3
(1 row)



       =20        =20         regards, tom=20 lane

---------------------------(end of=20 broadcast)---------------------------
TIP 3: if= =20 posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that=20 your
message can get through to the mailing lis= t=20 cleanly

------_=_NextPart_001_01C2192F.8C257EA0-- From tgl@sss.pgh.pa.us Fri Jun 21 15:30:38 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id BD4FE47666A for ; Fri, 21 Jun 2002 11:30:38 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id B0C18477079 for ; Fri, 21 Jun 2002 11:14:05 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5LFE3119880; Fri, 21 Jun 2002 11:14:03 -0400 (EDT) To: Felipe Nascimento Cc: pgsql-admin@postgresql.org Subject: Re: time stamp In-reply-to: References: Comments: In-reply-to Felipe Nascimento message dated "Fri, 21 Jun 2002 11:25:52 -0300" Date: Fri, 21 Jun 2002 11:14:02 -0400 Message-ID: <19877.1024672442@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200206/168 X-Sequence-Number: 4602 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 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. > 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 From Felipe.Nascimento@multivalor.com.br Fri Jun 21 18:55:19 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id D51EC477058 for ; Fri, 21 Jun 2002 14:55:19 -0400 (EDT) Received: from mail.multivalor.com.br (mail.multivalor.com.br [200.197.208.35]) by postgresql.org (Postfix) with ESMTP id 5A4A44772AB for ; Fri, 21 Jun 2002 13:39:54 -0400 (EDT) Received: from mvescexc01.esc.multivalor.com.br (mvescexc01.esc.multivalor.com.br [192.168.130.66]) by mail.multivalor.com.br (8.11.6/8.9.3) with ESMTP id g5LHddn11314; Fri, 21 Jun 2002 14:39:39 -0300 Received: by mvescexc01.esc.multivalor.com.br with Internet Mail Service (5.5.2653.19) id ; Fri, 21 Jun 2002 14:39:39 -0300 Message-ID: From: Felipe Nascimento To: "'Tom Lane'" Cc: pgsql-admin@postgresql.org Subject: Re: time stamp Date: Fri, 21 Jun 2002 14:39:29 -0300 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2194A.9891C700" X-Archive-Number: 200206/180 X-Sequence-Number: 4614 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C2194A.9891C700 Content-Type: text/plain; charset="iso-8859-1" Is this valid for Web applications where the db server's client is the web server? (web server resides on the same machine of the db server!) Or this is valid only for client x server applications? Felipe -----Original Message----- From: Tom Lane [mailto:tgl@sss.pgh.pa.us] Sent: sexta-feira, 21 de junho de 2002 12:14 To: Felipe Nascimento Cc: pgsql-admin@postgresql.org Subject: Re: [ADMIN] time stamp 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 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. > 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 ------_=_NextPart_001_01C2194A.9891C700 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable RE: [ADMIN] time stamp

Is this valid for Web applications where the db server's = client is the web server? (web server resides on the same machine of the db= server!)

Or this is valid only for client x server applications? <= /FONT>

Felipe

-----Original Message-----
From: Tom Lane [mai= lto:tgl@sss.pgh.pa.us]
Sent: sexta-feira, 21 de junho de 2002 12:14
To: Felipe Nascimento
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] time stamp


Felipe Nascimento <Felipe.Nascimento@multivalor.com.br= > writes:
> let's imagine that my server resides in Time Zone(T= Z) "-00", and one user
> resides in TZ "-05". Let=3DB4s say that 1= 2p.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 s= omeone else who
has TimeZone set differently looks at the stored value, = it will be shown
to them properly converted into their timezone.

This all works exactly the same as ordinary Unix timekeep= ing --- in
essence, everything is GMT inside the system, and rotati= on into a
particular timezone happens on-the-fly when a timestamp = value is
entered or displayed.  The TimeZone variable corres= ponds to the TZ
environment variable of Unix.

> 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)???=3D20

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

             = ;           reg= ards, tom lane

------_=_NextPart_001_01C2194A.9891C700-- From tswan@idigx.com Fri Jun 21 18:40:28 2002 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-- From tgl@sss.pgh.pa.us Fri Jun 21 22:53:10 2002 Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 4E478478F28 for ; Fri, 21 Jun 2002 18:53:10 -0400 (EDT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 322AF4774CE for ; Fri, 21 Jun 2002 17:35:49 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.4/8.11.4) with ESMTP id g5LLZh128948; Fri, 21 Jun 2002 17:35:44 -0400 (EDT) To: tswan@idigx.com Cc: Felipe Nascimento , pgsql-admin@postgresql.org Subject: Re: time stamp In-reply-to: <3D13662D.4000803@idigx.com> References: <19877.1024672442@sss.pgh.pa.us> <3D13662D.4000803@idigx.com> Comments: In-reply-to Thomas Swan message dated "Fri, 21 Jun 2002 12:45:17 -0500" Date: Fri, 21 Jun 2002 17:35:43 -0400 Message-ID: <28945.1024695343@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200206/185 X-Sequence-Number: 4619 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 From tswan@idigx.com Fri Jun 21 23:06:05 2002 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--