回答編集履歴

1

サンプルコードの修正

2016/04/14 09:07

投稿

tkturbo
tkturbo

スコア5572

test CHANGED
@@ -22,11 +22,13 @@
22
22
 
23
23
  ようするに「SimpleDateFormat」の使い方が間違ってるのです。
24
24
 
25
+ 「cal」がCalendarインスタンスだとすると、
26
+
25
27
 
26
28
 
27
29
  ```java
28
30
 
29
- String yearString = new SimpleDateFormat("yyyy").format(cal);
31
+ String yearString = new SimpleDateFormat("yyyy").format(cal.getTime());
30
32
 
31
33
  ```
32
34