3

In Android i have to parse a Date string("平成30年10月 24日") having Japanese Era to western date for comparison.Can anyone help in how to do this?

I have tried this to run in Android Studio and it is working fine:

  DateFormat format = new SimpleDateFormat("GGGGyy年MM月 dd日", new Locale("ja", "JP", "JP"));
  System.out.println( format.parse("平成30年10月 24日"));
  //output:Wed Oct 24 00:00:00 JST 2018

But when i tried in the mobile device i am getting Unparseable date Exception.

Minimum api level for projects in Android Studio is 19.


This is not the duplicate question with: Japanese Date Validation - Comparison

Here I want to parse the Japanese String Date.

NullPointer
  • 7,094
  • 5
  • 27
  • 41

0 Answers0