Re: [GENERAL] Extracting time from timestamp
От | Shridhar Daithankar |
---|---|
Тема | Re: [GENERAL] Extracting time from timestamp |
Дата | |
Msg-id | 200303211127.53101.shridhar_daithankar@persistent.co.in обсуждение исходный текст |
Список | pgsql-hackers |
On Thursday 20 Mar 2003 9:36 pm, Shridhar Daithankar<shridhar_daithankar@persistent.co.in> wrote: > I know this is rather stupid but still, > > I have a table which has a timestamp field in it and I need to get only > time part of it. i.e. HH:MI format. After much of RTFm( \df in psql in fact ), I found the solution. It is timetz(abstime(timestamp)). Well, timezone is OK with me but if somebody needs no timezones, then it is still screwed though.. Further more, \df I find following output time without time zone | pg_catalog | time| abstime time without time zone | pg_catalog | time| interval time without time zone | pg_catalog | time| text time without time zone | pg_catalog | time| time with time zone time without time zone | pg_catalog | time| time without time zone, integer time without time zone | pg_catalog | time| timestamp with time zone time without time zone | pg_catalog | time| timestamp without time zone I don't found these functions working as they expected. e.g. phd=# select time(abstime(timestamp 'now')) from bookings; ERROR: parser: parse error at or near "abstime" at character 13 phd=# select time(timestamp 'now') from bookings; ERROR: parser: parse error at or near "timestamp" at character 13 phd=# select version(); version --------------------------------------------------------------------- PostgreSQL 7.3.2 on i386-portbld-freebsd4.7, compiled by GCC 2.95.4 (1 row) That goes for any timestamp value I presume. Is this a bug or am I misinterpreting the information? Shridhar
В списке pgsql-hackers по дате отправления: