title: Java 8 LocalDateTime and ZonedDateTime conversion
body: <p>Given a zone name and the <code>outputDtf</code>, is this the best way to use Java 8 LocalDateTime and ZonedDateTime? I would like to simplify where possible.</p>
  
  <pre><code>String zoneName = "America/Los_Angeles";
  DateTimeFormatter outputDtf = DateTimeFormatter
          .ofPattern("yyyy-MM-dd'T'HH:mm:ssZ")
          .withZone(ZoneId.of(zoneName));
  
  // timestamp in UTC. convert to zone America/Los_Angeles
  DateTimeFormatter timestampDtf = DateTimeFormatter.ofPattern("yyyyMMddHHmmss");
  String timestamp = "20180722060602";
  LocalDateTime ldt = LocalDateTime.parse(timestamp, timestampDtf);
  Instant tsInstant = ldt.atZone(ZoneId.of("UTC")).toInstant();
  System.out.println(outputDtf.format(tsInstant));
  // 2018-07-21T23:06:02-0700
  
  // date in zone America/Los_Angeles. add start of day and zone
  DateTimeFormatter dateDtf = DateTimeFormatter.ofPattern("yyyy-MM-dd");
  String date = "2018-07-18";
  ZonedDateTime zdt = LocalDate.parse(date, dateDtf).atStartOfDay().atZone(ZoneId.of(zoneName));
  System.out.println(outputDtf.format(zdt));
  // 2018-07-18T00:00:00-0700
  </code></pre>