private static DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("uuuu-MM-dd'T'HH:mm:ss.SSSZ");
// 2019-01-21T01:29:17.000+0000形式
// Tをシングルクォートで囲まないと「Unknown pattern letter: T」エラー
// スレッドセーフ http://www.ne.jp/asahi/hishidama/home/tech/java/DateTimeFormatter.html
public OffsetDateTime getOffsetDateTimeValue(String key) {
return OffsetDateTime.parse(getStringValue(key), dateTimeFormatter);
}
More than 5 years have passed since last update.
SalesforceのREST APIで返ってくる日付時刻文字列をJava8でParse
Last updated at Posted at 2019-01-21
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme