Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group