Re: timestamp with time zone tutorial

Поиск
Список
Период
Сортировка
От Dennis Gearon
Тема Re: timestamp with time zone tutorial
Дата
Msg-id 976143.91212.qm@web82104.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на timestamp with time zone tutorial  (Dennis Gearon <gearond@sbcglobal.net>)
Ответы Re: timestamp with time zone tutorial
Список pgsql-general
None of the examples of converting a string to_timestamp() show using a time zone input as an input.Does it allow full
lengthtimezones for daylight savings time at the timestamp instant in time, or just an abbreviation for a fixed offset? 



--- On Sun, 7/19/09, Adrian Klaver <aklaver@comcast.net> wrote:

> From: Adrian Klaver <aklaver@comcast.net>
> Subject: Re: [GENERAL] timestamp with time zone tutorial
> To: "Dennis Gearon" <gearond@sbcglobal.net>
> Cc: pgsql-general@postgresql.org
> Date: Sunday, July 19, 2009, 5:15 PM
> On Sunday 19 July 2009 4:56:09 pm
> Dennis Gearon wrote:
> > I read it better, and it makes more sense now.
> >
> > But,
> > I'd like it to show how to insert:
> >     'strings' - which it does
> >     timestampz value -->using
> to_timestampz(...)
>
> For above:
> http://www.postgresql.org/docs/8.4/interactive/functions-formatting.html
>
> >     integers::timestampz
>
> See above or:
> http://www.postgresql.org/docs/8.4/interactive/functions-datetime.html
> In particular see
> 9.9.1. EXTRACT, date_part
>
> epoch
>
>     For date and timestamp values, the number of
> seconds since 1970-01-01
> 00:00:00 UTC (can be negative); for interval values, the
> total number of
> seconds in the interval
>
>     SELECT EXTRACT(EPOCH FROM TIMESTAMP WITH TIME
> ZONE '2001-02-16
> 20:38:40-08');
>     Result: 982384720
>
>     SELECT EXTRACT(EPOCH FROM INTERVAL '5 days 3
> hours');
>     Result: 442800
>
>     Here is how you can convert an epoch value
> back to a time stamp:
>
>     SELECT TIMESTAMP WITH TIME ZONE 'epoch' +
> 982384720 * INTERVAL '1 second';
>
>
>
> --
> Adrian Klaver
> aklaver@comcast.net
>

В списке pgsql-general по дате отправления:

Предыдущее
От: Chris
Дата:
Сообщение: Re: Should I CLUSTER on PRIMARY KEY
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: timestamp with time zone tutorial