Parse ZonedDateTime from string

Description

The following code shows how to parse ZonedDateTime from string.

Example


import java.time.ZonedDateTime;
/*from w ww  .jav a2  s .  co m*/
public class Main {
  public static void main(String[] args) {
    ZonedDateTime dateTime = ZonedDateTime.parse("2007-12-03T10:15:30+01:00[Europe/Paris]");
    System.out.println(dateTime);
  }
}

The code above generates the following result.





















Home »
  Java Date Time »
    Example »




Convert
Date
Timezone