commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Li Ying <liying.cn.2...@gmail.com>
Subject Re: BeanUtils.describe(...) Date Format
Date Tue, 28 Mar 2017 01:41:24 GMT
Hi Harri:

I read a little source code of the BeanUtils.describe(...) method.
Looks like it calls DateTimeConverter#convertToString method to convert
Data value to String.
And in the following source code:

>> if (useLocaleFormat && date != null) {
>>     .....
>> } else {
>>     result = value.toString();
>> }

If there is no format to use, it will simply call value.toString().

So I think maybe your [multiple java.util.Date properties] are actually
different sub-class of Date,
and their toString() methods are using different format.



=========================================
李 穎 (リ エイ / Li Ying)
EMail: liying.cn.2010@gmail.com
Mobile: (+81)-080-5403-9083
=========================================



2017-03-28 2:09 GMT+09:00 Harri T. <haba713@gmail.com>:

> Hi,
>
> I have a bean with multiple java.util.Date properties. Why does
> BeanUtils.describe(...) return some of them in format
>
>   2017-03-27 19:50:21.531
>
> and others in format
>
>   Mon Mar 27 19:50:28 EEST 2017
>
> ?
>
> The first format is preferred.
>
> Harri
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message