SimpleDateFormat wrong on Android

46 views
Skip to first unread message

Carlos Verdier

unread,
Apr 17, 2020, 11:11:05 AM4/17/20
to CodenameOne Discussions
I guess this is a regression. It works fine on emulator and iOS, but on Android, it fails. So:

SimpleDateFormat formatoMeta = new SimpleDateFormat("EE, d MMM");
formatoMeta
.format(new Date());

This returns "Fri, 17 de"
instead of "Fri, 17 Apr"

Shai Almog

unread,
Apr 18, 2020, 12:33:26 AM4/18/20
to CodenameOne Discussions
Are you using the com.codename1 version of the class or the java version of the class?
Make sure to always use the Codename One version for cross platform consistency.

Carlos Verdier

unread,
Apr 18, 2020, 4:30:35 AM4/18/20
to CodenameOne Discussions
Yes, I'm using the cn1 version:

import com.codename1.l10n.SimpleDateFormat;

Shai Almog

unread,
Apr 18, 2020, 10:16:23 PM4/18/20
to CodenameOne Discussions
Is this a valid localized date in your language?
It's possible the Android OS has the translation/localization. If not please file an issue on that.

Carlos Verdier

unread,
Apr 19, 2020, 6:53:52 AM4/19/20
to CodenameOne Discussions
I checked everything you said and still fails, so I filed a new issue. Thanks
Reply all
Reply to author
Forward
0 new messages