Re: How to extract hour and minutes from a timestamp
От | Andrew McMillan |
---|---|
Тема | Re: How to extract hour and minutes from a timestamp |
Дата | |
Msg-id | 1034883258.1154.901.camel@kant.mcmillan.net.nz обсуждение исходный текст |
Ответ на | How to extract hour and minutes from a timestamp (Tan ga <gndtanga@mail.pt>) |
Список | pgsql-novice |
On Fri, 2002-10-18 at 05:52, Tan ga wrote: > Hi again :) > > I already resolver my other problem but now i would like to extract both > time and hour from a timestamp in order to compare with a string. > Ex 2000-01-01 19:30:00 > I want the result to be 19:30 > > With select substr(....) i can do this but that's not what i want. > > I'm using python with postgres. See: http://www.ca.postgresql.org/users-lounge/docs/7.2/postgres/functions-formatting.html Something like: to_char( my.timestamp, 'YYYY-MM-DD HH24:MI') Cheers, Andrew. -- --------------------------------------------------------------------- Andrew @ Catalyst .Net.NZ Ltd, PO Box 11-053, Manners St, Wellington WEB: http://catalyst.net.nz/ PHYS: Level 2, 150-154 Willis St DDI: +64(4)916-7201 MOB: +64(21)635-694 OFFICE: +64(4)499-2267 Survey for free with http://survey.net.nz/ ---------------------------------------------------------------------
В списке pgsql-novice по дате отправления: