Re: Formatting current_time output

Josh Berkus <josh@agliodbs.com>

From: "Josh Berkus" <josh@agliodbs.com>
To: Thomas Good <tomg@sqlclinic.net>, Postgres SQL <pgsql-sql@postgreSQL.org>
Date: 2002-10-03T15:03:06Z
Lists: pgsql-sql
Thomas,

> SELECT TO_CHAR(SYSDATE,'HH:MI AM') FROM DUAL; -- Oracle
> SELECT TIME_FORMAT(current_time,'%l:%i %p');  -- MySQL
> 
> Returned:   10:58 AM
> 
> I've found lpad(current_time,5); which gets me 1/3 of the way.
> Is there a function I haven't found?

Um, what's wrong with:
SELECT to_char(current_time, 'HH12:MI AM');
?

(See "Formatting Functions" under "Functions and Operators" in the
User's Guide)

-Josh Berkus