質問編集履歴
2
変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
Calendarクラス使って値をセットすると31日のみ翌月1日に変わってしまいます。(例:3/31が4/1となる)
|
2
2
|
このような場合に31日として読み込む方法は他にどのようなものがあるのでしょうか。
|
3
3
|
|
4
4
|
現在は下記の方法で取得しています、
|
1
変数宣言を追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -3,6 +3,10 @@
|
|
3
3
|
|
4
4
|
現在は下記の方法で取得しています、
|
5
5
|
```java
|
6
|
+
int testYear = 2018;
|
7
|
+
int testMonth = 3;
|
8
|
+
int testDay = 31;
|
6
9
|
Calendar testDate = Calendar.getInstance();
|
7
10
|
testDate.set(testYear,testMonth,testDay);
|
11
|
+
System.out.println(testDate);//2018,4,1と表示される
|
8
12
|
```
|