[rules-users] Date format [MMM-dd-yyyy] can NOT work in Chinese environment. How to set locale or language of drools?

Zeke xanadu860122 at gmail.com
Thu Apr 2 21:39:47 EDT 2009


Thank you! This works well!

- Zeke

2009/4/2 Héron Nicolas <nheron at sopragroup.com>

>  Hello,
> the default date format is "dd-MMM-yyyy"
> if you want to change there is a property to change drools.dateformat
> you can set it like this
> System.setProperty( "drools.dateformat", "dd/MM/YYYY" );
> you can also set the the next properties like this
> System.setProperty( "drools.defaultlanguage", "en" );
> System.setProperty( "drools.defaultcountry" ,"US" );
> that will override the default settings which are "en" and "US"
> regards
> Nicolas Héron
>
> Le mercredi 01 avril 2009 à 09:33 -0700, Greg Barton a écrit :
>
> You would have to set the default Locale of the JRE.
>
> Either call Locale.setDefault(Locale.US) (class java.util.Locale) before you parse any dates, or launch java with the user.country property set to US.
>
> For more than you'd ever want to know about Locales, see this: http://java.sun.com/docs/books/tutorial/i18n/locale/index.html
>
> --- On Wed, 4/1/09, Zeke <xanadu860122 at gmail.com> wrote:
>
> > From: Zeke <xanadu860122 at gmail.com>
> > Subject: [rules-users] Date format [MMM-dd-yyyy] can NOT work in Chinese environment. How to set locale or language of drools?
> > To: "rules-users" <rules-users at lists.jboss.org>
> > Date: Wednesday, April 1, 2009, 11:11 AM
> > Hi, Friends:
> >   I am using Drools 4.0.7. I set the date format as
> > [MMM-dd-yyyy], My
> > machine locale is China, and the language is Chinese. I
> > find that if I have
> > a rule like "when date > Jan-01-2009", drools
> > will throw exception like
> > "Jan-01-2009 does not follow [MMM-dd-yyyy]". But
> > if I change "Jan" to
> > Chinese charactor which is "一月",  runtime
> > will be OK.  So I think it is a
> > locale/language issue.
> >   Is there anyway to set locale/language of drools? That is
> > even if my
> > environment is Chinese, I still can use the English date
> > format? Or is there
> > any other way can help me out?
> >
> > Thanks
> > - Zeke
> > _______________________________________________
> > rules-users mailing list
> > rules-users at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> _______________________________________________
> rules-users mailing listrules-users at lists.jboss.orghttps://lists.jboss.org/mailman/listinfo/rules-users
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20090403/4ac40046/attachment.html 


More information about the rules-users mailing list