1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SalesforceのREST APIで返ってくる日付時刻文字列をJava8でParse

Last updated at Posted at 2019-01-21
    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);
    }
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?