cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Muench" <>
Subject Re: How to do formatting of dates and times with SQLProcessor
Date Fri, 03 Dec 1999 15:42:29 GMT

Can't you just rely on the database to format
the date in the format you want and keep the
<query> tags simpler?

  SELECT TO_CHAR(hiredate,'Month DD, YYYY) as hiredate

Databases have pretty evolved number/date formatting
routines that handle all the NLS/locale issues already.

Seems like a problem that you could push down a layer
and keep the model simpler in the "page"...

Just a thought.

Steve Muench, Consulting Product Manager & XML Evangelist
Business Components for Java Development Team
----- Original Message -----
From: Ed Ward <>
To: <>
Sent: Friday, December 03, 1999 6:53 AM
Subject: Re: How to do formatting of dates and times with SQLProcessor

On Fri, 3 Dec 1999 00:31:58 -0500 (EST), you wrote:

>Hi guys. I'm trying to figure out how to configure SQLProcessor to format
>dates and times nicely. The naive approach would be something like this:
><query date-format="yyyy-MM-dd" time-format="hh:mm:ss"
>timestamp-format="yyyy-MM-dd hh:mm:ss">
>but suppose you have more than one date column and you want to specify
>different formats for the different columns? One of my local users
>suggested this:
> <date-format>yyyy-MM-dd</date-format>
> <date-format column="other_column_name">MMM d, yyyy</date-format>
>which might work, but it's a break from the tradition of putting all
>resultset configuration options in the query element. It does, however,
>greatly simplify setting column-specific options. Does anyone have either
>an argument to make for one of these options or an alternate suggestion?
>- donald

How about :

<column name="date1" format-type="date" format="yyyy-MM-dd">

It still doesn't solve your problem of breaking from the tradition of
all the configuration options in the query element, but its not so tied to
problem of formatting dates.


View raw message