LoginSignup
1
0

More than 3 years have passed since last update.

com.google.api.client.util.DateTime

Last updated at Posted at 2018-08-15

com.google.api.client.util.DateTime.parseRfc3339(String)

の引数に渡す文字列のフォーマットって、こんなんなんですね~。

/** Regular expression for parsing RFC3339 date/times. */
private static final Pattern RFC3339_PATTERN = Pattern.compile(
"^(\\d{4})-(\\d{2})-(\\d{2})" // yyyy-MM-dd
+ "([Tt](\\d{2}):(\\d{2}):(\\d{2})(\\.\\d+)?)?" // 'T'HH:mm:ss.milliseconds
+ "([Zz]|([+-])(\\d{2}):(\\d{2}))?"); // 'Z' or time zone shift HH:mm following '+' or '-'

ここに渡したいインプットに秒がない時に無理やりくっつけないとLocalTimeに0秒渡しても
Stringにしたときに出力してくれないから面倒だった...

1
0
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
0