How to extract time zone from ISO-8601 date string in Java 8.
e.g:
String timestamp1 = "2014-02-15T01:02:03Z" ;
String timestamp2 = "2017-10-27T16:22:27.605-05:30";
Thanks.
How to extract time zone from ISO-8601 date string in Java 8.
e.g:
String timestamp1 = "2014-02-15T01:02:03Z" ;
String timestamp2 = "2017-10-27T16:22:27.605-05:30";
Thanks.
Use ZonedDateTime:
to get an instance of ZoneId.
Alternatively you can use
getOffset()
to obtain ZoneOffset,which is more handy if you need to access the timezone offset in a numeric form.