Re: Time zone offset in to_char()

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Time zone offset in to_char()
Дата
Msg-id e0166046-fabf-49c4-a754-b0868e003563@aklaver.com
обсуждение исходный текст
Ответ на Re: Time zone offset in to_char()  (Alban Hertroys <haramrae@gmail.com>)
Список pgsql-general
On 1/11/24 11:04, Alban Hertroys wrote:
> 

> I did manage to apply it to the second function header, which I think behaves such that the time zone change stays
withinfunction scope. Right now I’m not 100% sure that I verified that. More to check tomorrow.
 


CREATE OR REPLACE FUNCTION public.tz_fnc2()
  RETURNS void
  LANGUAGE plpgsql
  SET "TimeZone" TO 'UTC'
AS $function$
BEGIN
     RAISE NOTICE '%', to_char(now(), 'OF');
END;
$function$;


test=# begin ;
BEGIN
test=*# select public.tz_fnc2();
NOTICE:  +00
  tz_fnc2
---------

(1 row)

test=*# show timezone;
  TimeZone
----------
  UTC
(1 row)

test=*# commit ;
COMMIT
test=# show timezone;
  TimeZone
----------
  UTC
(1 row)


> 
> Frankly, I do hope that you’re right here, that would make my work easier.
> 
> Alban Hertroys
> --
> If you can't see the forest for the trees,
> cut the trees and you'll find there is no forest.
> 

-- 
Adrian Klaver
adrian.klaver@aklaver.com




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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Time zone offset in to_char()
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: Refresh Materialized View Issue