Re: How to extract hour and minutes from a timestamp

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Tan ga <gndtanga(at)mail(dot)pt>, pgsql-novice(at)postgresql(dot)org
Subject: Re: How to extract hour and minutes from a timestamp
Date: 2002-10-17 19:37:59
Message-ID: web-1790252@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Tan ga,

> 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

Check out "Functions and Operators" in the online user manual.

What you want is:

SELECT to_char(some_timestamp, 'HH:MI');

-Josh Berkus

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Randy Neumann 2002-10-17 20:15:11 Re: char() or varchar() for frequently used column
Previous Message Andrew McMillan 2002-10-17 19:34:19 Re: How to extract hour and minutes from a timestamp