commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <craig...@apache.org>
Subject Re: [beanutils] java.util.Date converter
Date Fri, 05 Mar 2004 19:06:50 GMT
Quoting Flavio Tordini <flaviotordini@tin.it>:

> hi craig,
> thank you for your answer. i think the date formats to use are those in 
>   ISO 8601.
> 
> see: http://www.w3.org/TR/NOTE-datetime
> 
> maybe the converter could be added to the beanutils codebase but not 
> used by default by ConvertUtils. what do you think?
> 

That is one of at least twenty different formats for dates and times that people
like to use (and would be pretty user-unfriendly in a locale that likes
dd/mm/yyyy formatted dates).  It doesn't seem reasonable to pick just one, so
I'd prefer to let applications that want to use a particular format to register
their own.

> flavio

Craig


> 
> Craig R. McClanahan wrote:
> > Quoting Flavio Tordini <flaviotordini@tin.it>:
> > 
> > 
> >>hi all,
> >>i'm trying to set a bean property of type java.util.Date from a String 
> >>value. From the docs it appears that there's no default Converter to do 
> >>this. I understand I have to write my own Converter, but I'm sure that 
> >>someone else must have faced the problem before me. Can someone please 
> >>post the Converter?
> >>It would be nice to have this Converter built in the BeanUtils package. 
> >>If I write my own should I post it back to this list?
> >>
> > 
> > 
> > The reason there isn't a standard Date converter is that the string format
> of a
> > date is locale specific (for example, dd/mm/yyyy versus mm/dd/yyyy), and
> the
> > basic converter utilities have no notion of locale.
> > 
> > Within commons-beanutils, you could investigate using the locale-sensitive
> > conversion utilities instead.
> > 
> > 
> >>flavio
> > 
> > 
> > Craig
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message