Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 00DB1475E60 for ; Thu, 3 Oct 2002 11:04:57 -0400 (EDT) Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (Postfix) with ESMTP id 5FD56475DC5 for ; Thu, 3 Oct 2002 11:04:56 -0400 (EDT) Received: from [63.195.55.98] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.9) with HTTP id 1770248; Thu, 03 Oct 2002 08:03:06 -0700 From: "Josh Berkus" Subject: Re: Formatting current_time output To: Thomas Good , Postgres SQL X-Mailer: CommuniGate Pro Web Mailer v.3.5.9 Date: Thu, 03 Oct 2002 08:03:06 -0700 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/37 X-Sequence-Number: 9755 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