Re: Mailing

From: Robby Russell <robby(at)planetargon(dot)com>
To: Todd P Marek <affe23(at)somahq(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Mailing
Date: 2004-10-05 14:58:23
Message-ID: 1096988303.15194.2.camel@vacant
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 2004-10-05 at 09:32 -0500, Todd P Marek wrote:
>
>
> ______________________________________________________________________
>
> Hello-
>
> I am in the process of translating a site using mysql as the backend
> over to postgres. I have a lot of time data that I would like to
> display to the user in the form of a schedule.
>
> I am using the to_char function to make the times human friendly
>
> to_char(class_schedule.endtime, 'HH:MI:SS AM')
>
> which returns
>
> 06:30:00 AM - 07:30:00 AM
>
> I am really looking to get it outputting like this.
>
> 6:30 AM - 7:30 AM
>

Yeah, you're getting exactly what you're asking PostgreSQL to give you.
Drop the ':SS' if you don't want the seconds.

You can find out more about how you can format your date/times here:
http://www.postgresql.org/docs/current/static/functions-
formatting.html#FUNCTIONS-FORMATTING-DATETIME-TABLE

Good luck,

Robby

--
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON | www.planetargon.com
* Portland, OR | robby(at)planetargon(dot)com
* 503.351.4730 | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
****************************************/

In response to

  • Mailing at 2004-10-05 14:32:10 from Todd P Marek

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Barnard 2004-10-05 15:00:29 Re: Mailing
Previous Message Stephan Szabo 2004-10-05 14:58:03 Re: Mailing