ちょっとした質問です。 Android Studioでは日付を「09/05/2017」と入力することができますか?それは火曜日であることをユーザーに出力しますか?日付を入力すると、自動的にその日がわかります
-1
A
答えて
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();
}
関連する問題
- 1. ディスプレイ自動日付が入力
- 2. ASP.NET mvc:日付フィールドに今日の日付を自動的に入力する方法は?
- 3. HTMLマニュアル自動フォーマットの日付入力
- 4. 今日の日付に自動的に入力してください
- 5. ブートストラップdatetimepickerによって自動的に日付が入力されます
- 6. 自動日付ユーザフォームデータを入力した後に入力
- 7. 自動的にデータベースに日付を挿入します
- 8. 日付を挿入する際の動的スマート日付マスク
- 9. は自動的に日付が
- 10. 角度2は、ある日付入力が他の日付入力と同じかそれより前であることを確認します
- 11. Excelの日付に数日を追加して別のシートにセルを自動入力すると
- 12. 入力した日付と日付を比較する
- 13. 別の日付フィールドに日付を入力する
- 14. パンダは自動的に日付を認識できますか?
- 15. Behat「私は次のフィールドに記入するときに」日付を日付に入力しますか?
- 16. 自動入力で日付パターンが取得されない
- 17. JavaScript - 日付を入力し、次のフィールドに差がある場合は自動入力します
- 18. Excel(2003) - セルに自動挿入日付
- 19. ボタンに日付を自動的に割り当てる方法
- 20. Pythonは自動的に日付
- 21. 日付の代わりに自動的にダッシュを取得するにはどうすればいいですか?入力押しながら
- 22. 日付入力フィールドに日付を追加する角度
- 23. 代わりにタイムスタンプタイプのSAP自動予測ライブラリ日付
- 24. 日付フィールド値を含むテキストフィールドの自動入力
- 25. 入力時のデータのフレックスフォーマット入力(日付フィールド/日付)?
- 26. 入力日付が今日の日付と等しいかどうかをチェックする方法は?
- 27. ユーザーが入力した日付を7日追加する日付計算プログラム
- 28. 入力タイプ= "日付"の日付を解析する方法は?
- 29. リフレッシュボタンが選択された日付でセルを自動入力する
- 30. VBAマクロで今日までの日付を入力する
Googleのそれはしてください。 – Furqan
コードはどこにありましたか? – Pavan
検索しましたか?私は '' Java date to day name "' – Denny