Thread: Re: [HOW TO:] timestamp WITHOUT timezone

Re: [HOW TO:] timestamp WITHOUT timezone

From
Vivek Khera
Date:
>>>>> "CF" == Christophe Faizant <cfaizant@prisma-presse.com> writes:

CF> I have the following problem with my postgresql "timestamp" type
CF> field.  I don't wish to get a timezone attribute after the
CF> timestamp, but each time I browsed rows via phppgadmin or via my
CF> php pages, I've gotten an additional

Timestamps always have timezone.  No way around it.  You need to alter
your application to deal with it.


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/

Re: Re: [HOW TO:] timestamp WITHOUT timezone

From
Jason Earl
Date:
Actually you could use the to_char function and do
something like:


processdata=> select to_char(now(), 'YYYY-MM-DD
HH24:MI');
     to_char
------------------
 2001-08-02 13:45
(1 row)

It sometimes can cause confusion to leave timestamps
off, but you can format your timestamps however you
please using to_char.

Good Luck,
Jason

--- Vivek Khera <khera@kcilink.com> wrote:
> >>>>> "CF" == Christophe Faizant
> <cfaizant@prisma-presse.com> writes:
>
> CF> I have the following problem with my postgresql
> "timestamp" type
> CF> field.  I don't wish to get a timezone attribute
> after the
> CF> timestamp, but each time I browsed rows via
> phppgadmin or via my
> CF> php pages, I've gotten an additional
>
> Timestamps always have timezone.  No way around it.
> You need to alter
> your application to deal with it.
>
>
> --
>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Vivek Khera, Ph.D.                Khera
> Communications, Inc.
> Internet: khera@kciLink.com       Rockville, MD
>  +1-240-453-8497
> AIM: vivekkhera Y!: vivek_khera
> http://www.khera.org/~vivek/
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to
majordomo@postgresql.org


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: Re: [HOW TO:] timestamp WITHOUT timezone

From
Tom Lane
Date:
Vivek Khera <khera@kcilink.com> writes:
> "CF" == Christophe Faizant <cfaizant@prisma-presse.com> writes:
> CF> I have the following problem with my postgresql "timestamp" type
> CF> field.  I don't wish to get a timezone attribute after the
> CF> timestamp, but each time I browsed rows via phppgadmin or via my
> CF> php pages, I've gotten an additional

> Timestamps always have timezone.  No way around it.  You need to alter
> your application to deal with it.

Not necessarily.  You could use a view that formats the timestamp the
way your application wants (see to_char()).

            regards, tom lane