自分の作ったアプリで和暦を使っていなくても、ユーザのカレンダー設定が和暦だったりすると 日付表示がおかしくなることがあります。 カレンダー設定を和暦に変更して実機での動作確認をすればいいのですが、いつもそれを気にして確認などはしないですし忘れがちです。 それに、設定によって挙動が変わってしまうのであれば、日付に関するテストコードを書いても意味がなくなってしまいます。 事前調査 iPhoneの設定でカレンダーを和暦に設定した上で、適当なアプリにNSLog(@"%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLocale"]); で記述して起動します。 そうすると、現在選択されているロケールが取得出来ます。 OCMockを使って和暦設定時のロケールを返すMockを作成 OCMockを使い、先ほど取得したロケールを返