Re: timestamp_part() bug?
От | Karel Zak |
---|---|
Тема | Re: timestamp_part() bug? |
Дата | |
Msg-id | 20020227095251.D24777@zf.jcu.cz обсуждение исходный текст |
Ответ на | timestamp_part() bug? (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Список | pgsql-hackers |
On Wed, Feb 27, 2002 at 05:07:50PM +0900, Tatsuo Ishii wrote: > I see following in the manual: > > ------------------------------------------------------------------- > The seconds field, including fractional parts, multiplied by > 1000. Note that this includes full seconds. > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > SELECT EXTRACT(MILLISECONDS FROM TIME '17:12:28.5'); > Result: 28500 > ------------------------------------------------------------------- > > And I see: > > test=# select current_timestamp,extract(milliseconds from current_timestamp); > timestamptz | date_part > -------------------------------+----------- > 2002-02-27 14:45:53.945529+09 | 945.529 > (1 row) > > Apparently there's an inconsistency among manuals, timestamp(tz)_part > and timetz_part. Does anybody know which one is correct? I hope bug is in the manual -- for example minutes the "extract" returns without hours. Is any matter why returs milliseconswith seconds?If somebody wants milliseconds with seconds: # select extract(SECONDS from '14:45:53.945529'::time) * 1000; ?column? ------------------53945.5289999969 (1 row) BTW, to_char() retuns milliseconds without seconds too: test=# select to_char('2002-02-27 14:45:53.945529+09'::timestamp, 'MS');to_char ---------946 (1 row) Karel -- Karel Zak <zakkr@zf.jcu.cz>http://home.zf.jcu.cz/~zakkr/C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
В списке pgsql-hackers по дате отправления: