Here you can find the source of getTime(ZonedDateTime zonedTime)
public static String getTime(ZonedDateTime zonedTime)
//package com.java2s; //License from project: Open Source License import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; public class Main { protected static DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMddkkmm"); public static String getTime(ZonedDateTime zonedTime) { ZonedDateTime newYorkTime = zonedTime.withZoneSameInstant(ZoneId.of("America/New_York")); return formatter.format(newYorkTime); }// w ww. j a v a 2 s.com }