I want to to select the time of a date from database. How can I do this using postgresql database?
3 Answers
You can use the date_part function, like this:
date_part('hour', timestamp '2001-02-16 20:38:40')
This would give you 20 for example.
For more information, refer to http://www.postgresql.org/docs/8.2/interactive/functions-datetime.html