List of utility methods to do ZonedDateTime Format
String | format(ZonedDateTime zdt, DateTimeFormatter dtf) format return zdt.format(dtf);
|
String | format(ZonedDateTime zonedDateTime) format return zonedDateTime.format(DateTimeFormatter.ISO_ZONED_DATE_TIME);
|
String | formatDate(ZonedDateTime dateTime) Format a ZonedDateTime as RFC 1123 date format used in HTTP. return RFC_1123_DATE_TIME.format(dateTime.withZoneSameInstant(GMT));
|
String | formatDate(ZonedDateTime dt) format Date DateTimeFormatter fmt = DateTimeFormatter.ISO_OFFSET_DATE_TIME.withZone(ZoneOffset.UTC);
return fmt.format(dt.truncatedTo(ChronoUnit.SECONDS));
|
String | formatDate_ddMMYYYYHHmmss(ZonedDateTime now) format Datdd MMYYYYH Hmmss return now.format(dateTimeFormatPattern);
|
String | formatDateAsShortDateLocalTime(ZonedDateTime moonDate, ZoneId tz) Useful date-to-string formatting which I found myself using a lot return moonDate.withZoneSameInstant(tz).format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); |
String | formatDateForGMT(ZonedDateTime moonDate) Useful date-to-string formatting which I found myself using a lot DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd"); return moonDate.withZoneSameInstant(ZoneOffset.UTC).format(df); |
String | formatDateTime(ZonedDateTime zonedDateTime) format Date Time return DEFAULT_DATETIME_FORMATTER.format(zonedDateTime);
|
String | formatZonedDateTime(ZonedDateTime zonedDateTime) format Zoned Date Time DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("dd.MM.yyyy HH:mm zZ", Locale.getDefault()); return zonedDateTime.format(dateTimeFormatter.withZone(getZoneId())); |
String | getFormattedHour(ZonedDateTime dateTime) get Formatted Hour if (dateTime.getHour() < 10) { return "0" + dateTime.getHour(); return String.valueOf(dateTime.getHour()); |