0

I'm having this String date as following: 2016-08-20T00:00:00-07:00

What is the meaning of "-07:00" and how to convert that to a ZonedDateTime of my choice (ex "America/New_York" )?

Gonzague
  • 332
  • 3
  • 16
  • Have a look at [Convert Java Date into XML Date Format (and vice versa)](http://stackoverflow.com/questions/4099862/convert-java-date-into-xml-date-format-and-vice-versa) for the `String` > `Date` conversion. – Mick Mnemonic Aug 20 '16 at 01:52
  • `ZonedDateTime.parse("2016-08-20T00:00:00-07:00").withZoneSameInstant(ZoneId.of("America/New_York"))` which returns `2016-08-20T03:00-04:00[America/New_York]` – Andreas Aug 20 '16 at 02:03
  • @Andreas can you provide answer for android? – Prasad Aug 26 '16 at 13:18
  • @Prasad Why? Question is for Java 8, as implicitly given by the text *"convert that to a `ZonedDateTime`"*, and [`ZonedDateTime`](https://docs.oracle.com/javase/8/docs/api/java/time/ZonedDateTime.html) was added in Java 8. – Andreas Aug 26 '16 at 21:35

0 Answers0