Re: Date/Time Conversion

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Date/Time Conversion
Дата
Msg-id 8222.1112500236@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Date/Time Conversion  (James G Wilkinson <jgw@alpinegeophysics.com>)
Ответы Re: Date/Time Conversion  (Yasir Malik <ymalik@cs.stevens.edu>)
Список pgsql-sql
James G Wilkinson <jgw@alpinegeophysics.com> writes:
> beta_jgw=# update scenario1.time_test set local_day = extract(day from 
> to_timestamp(to_char(gmt_date,'YYYY-MM-DD')||' 
> '||to_char(gmt_hour,'99')||':00:00-00','YYYY-MM-DD HH24:MI:SS') at time 
> zone 'EST');

That seems like a mighty ugly way to do it; have you considered some
kind of timestamp arithmetic instead?  But anyway, I suspect your
problem is you need a few 'FM' format specs to keep the to_char
functions from introducing unwanted spaces.  Look at the intermediate
results of your expressions.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Query history file
Следующее
От: PFC
Дата:
Сообщение: Re: Query history file