I can try to use 'L' character in pattern(http://developer.android.com/reference/java/text/SimpleDateFormat.html):
SimpleDateFormat sdf2 = new SimpleDateFormat("d LLLL y 'г'. H:mm:ss z", new Locale("ru", "RU"));
but i get this exception:
java.lang.IllegalArgumentException: Unknown pattern character - 'L'
Any ideas, why it happens?
The L character pattern seems not supported on Android versions 2.2 and below. I found the same problem when looking for a solution for date formats in slavic languages (see my comment to XtopherSD's answer). I ended up coding the format conditionally:
String fmt = Build.VERSION.SDK_INT <= 8 ? "MMMM yyyy" : "LLLL yyyy";
SimpleDateFormat sdfDate = new SimpleDateFormat(fmt);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With