Here you can find the source of formatZonedDateTime(ZonedDateTime zonedDateTime)
public static String formatZonedDateTime(ZonedDateTime zonedDateTime)
//package com.java2s; //License from project: Creative Commons License import java.time.ZoneId; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; import java.util.Locale; public class Main { public static String formatZonedDateTime(ZonedDateTime zonedDateTime) { DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm zZ", Locale.getDefault()); return zonedDateTime.format(dateTimeFormatter.withZone(getZoneId())); }// ww w. jav a2 s .co m private static ZoneId getZoneId() { return ZoneId.systemDefault(); } }