2017-05-09 3 views

答えて

3

その

 String dateString = "09/05/2017"; 
     try { 
      Date date1 = new SimpleDateFormat("dd/MM/yyyy").parse(dateString); 
      String day = new SimpleDateFormat("EEEE").format(date1); 
      System.out.print(day); 
     } catch (ParseException e) { 
      e.printStackTrace(); 
     } 
+0

ありがとうございます。それはうまくいった! :) –

+0

@ kasperもしあなたがうまくいくなら答えを受け入れてください –

0

のための使用このコードは、このcode`を試してみてください:

try { 
      String input = "09/05/2017"; 
      SimpleDateFormat inFormat = new SimpleDateFormat("dd/MM/yyyy"); 
      Date date = inFormat.parse(input); 
      SimpleDateFormat outFormat = new SimpleDateFormat("EEEE"); 
      String goal = outFormat.format(date); 
      Toast.makeText(getApplicationContext(), goal, Toast.LENGTH_SHORT).show(); 
     } catch (Exception e) { 
      e.printStackTrace(); 
     } 
関連する問題