Here you can find the source of toZonedDateTime(String date, DateTimeFormatter formatter)
public static ZonedDateTime toZonedDateTime(String date, DateTimeFormatter formatter)
//package com.java2s; //License from project: Open Source License import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class Main { public static ZonedDateTime toZonedDateTime(String date, DateTimeFormatter formatter) { try {/*from w ww .jav a2 s . co m*/ return ZonedDateTime.parse(date, formatter); } catch (Exception e) { throw new IllegalArgumentException(e); } } }