Re: Date trunc in UTC

Поиск
Список
Период
Сортировка
От Thrasher
Тема Re: Date trunc in UTC
Дата
Msg-id 3DDB65ED.70101@fibers.upc.es
обсуждение исходный текст
Ответ на Date trunc in UTC  (Thrasher <thrasher@fibers.upc.es>)
Ответы Re: Date trunc in UTC  (Richard Huxton <dev@archonet.com>)
Список pgsql-sql
No I cannot use SET TIME ZONE.

SET TIME ZONE will be set by any client backend. But what I want to get 
is that DATE_TRUNC('month', <now in timezone +1>) = DATE_TRUNC('month', 
<now in timezone -7>).



Richard Huxton wrote:
> On Wednesday 20 Nov 2002 9:44 am, Thrasher wrote:
> 
>>Hi
>>
>>I do not know if it's an error, but in this query
>>
>>=# select date_trunc ('month', now ());
>>        date_trunc
>>------------------------
>>  2002-11-01 00:00:00+01
>>(1 row)
>>
>>I've got the truncated date dependant to my timezone.
>>
>>Instead, I would like to have as a result
>>
>>  2002-11-01 01:00:00+01
>>
>>which is correct, but I cannot set the whole server to UTC. Any way to
>>get this ?
> 
> 
> Perhaps SET TIME ZONE is what you want. See the manual section on date/time 
> types for details.
> 



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

Предыдущее
От: Richard Huxton
Дата:
Сообщение: Re: Date trunc in UTC
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: Problems invoking psql. Help please.