You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Lukasz Lenart <lu...@apache.org> on 2018/11/12 09:04:16 UTC

Date format change

Hi,

As I'm working on adding support for JDK9 & 11 I found an issue with
datetime formatting. Here it is an example code:

System.out.println(SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM,
DateFormat.MEDIUM, Locale.UK).format(new Date()));

and under JDK8 it will produce:
12-Nov-2018 09:56:41

but under JDK9 it will be
12 Nov 2018, 09:57:47

I cannot find anything related to this change. I wonder maybe we
should use [1] to support LocalDate in Java7, wdyt?

[1] https://www.threeten.org/threetenbp/


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


Re: Date format change

Posted by Lukasz Lenart <lu...@apache.org>.
śr., 14 lis 2018 o 15:10 Yasser Zamani <ya...@apache.org> napisał(a):
> >To persist an old behaviour, the following flag must be defined -
> >Djava.locale.providers=COMPAT, CLDR
>
> I think we shouldn't force this flag in Struts builds, tests and releases as it's user decision to run Struts in which java version (and so what date format would like to type a date in UI). If an incompatible date format typed and posted to Struts, then it's OK for Struts to fail!

What I meant is to use this for builds on Jenkins, define a profile in
pom.xml to enable those flags per JDK.


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org


RE: Date format change

Posted by Yasser Zamani <ya...@apache.org>.

>-----Original Message-----
>From: Lukasz Lenart <lu...@apache.org>
>Sent: Monday, November 12, 2018 12:44 PM
>To: Struts Developers List <de...@struts.apache.org>
>Subject: Re: Date format change
>
>Ok, found it
>https://bugs.openjdk.java.net/browse/JDK-8206961
>
>tldr; some date formats have changed since JDK9 as a result of using the Unicode
>Consortium's Common Locale Data Repository (CLDR)
>
>To persist an old behaviour, the following flag must be defined -
>Djava.locale.providers=COMPAT, CLDR

I think we shouldn't force this flag in Struts builds, tests and releases as it's user decision to run Struts in which java version (and so what date format would like to type a date in UI). If an incompatible date format typed and posted to Struts, then it's OK for Struts to fail!

We just need to update a unit test which I already have pull requested at [1].

Regards.

[1] https://github.com/apache/struts/pull/262/files#diff-fb5059fc7e863b3fc70d933d7cbefad2R378

Re: Date format change

Posted by Lukasz Lenart <lu...@apache.org>.
Ok, found it
https://bugs.openjdk.java.net/browse/JDK-8206961

tldr; some date formats have changed since JDK9 as a result of using
the Unicode Consortium's Common Locale Data Repository (CLDR)

To persist an old behaviour, the following flag must be defined
-Djava.locale.providers=COMPAT, CLDR


Regards
-- 
Łukasz
+ 48 606 323 122 http://www.lenart.org.pl/

pon., 12 lis 2018 o 10:04 Lukasz Lenart <lu...@apache.org> napisał(a):
>
> Hi,
>
> As I'm working on adding support for JDK9 & 11 I found an issue with
> datetime formatting. Here it is an example code:
>
> System.out.println(SimpleDateFormat.getDateTimeInstance(DateFormat.MEDIUM,
> DateFormat.MEDIUM, Locale.UK).format(new Date()));
>
> and under JDK8 it will produce:
> 12-Nov-2018 09:56:41
>
> but under JDK9 it will be
> 12 Nov 2018, 09:57:47
>
> I cannot find anything related to this change. I wonder maybe we
> should use [1] to support LocalDate in Java7, wdyt?
>
> [1] https://www.threeten.org/threetenbp/
>
>
> Regards
> --
> Łukasz
> + 48 606 323 122 http://www.lenart.org.pl/

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org