List of utility methods to do ZoneId
ZoneId | getZoneId(String tzId) get Zone Id return ZoneId.of(tzId, ZoneId.SHORT_IDS);
|
LocalDate | now() Get localized LocalDate, using Europe / Paris time zone. return LocalDate.now(EUROPE_PARIS);
|
ZonedDateTime | parseBuildTimestamp(String buildTimestamp) parse Build Timestamp return parseToZonedDateTime(buildTimestamp + " +0000", "yyyy-MM-dd HH:mm Z"); |
ZonedDateTime | parseDateTime(String yyyymmdd, String hhmmss) parse Date Time return parseDateTime(yyyymmdd, hhmmss, ZoneId.systemDefault());
|
ZonedDateTime | parseDateToZdt(Date date) parse Date To Zdt return ZonedDateTime.ofInstant(date.toInstant(), zoneId);
|
ZoneId | parseTimeZone(String timeZoneStr) parse Time Zone if (timeZoneStr == null || timeZoneStr.trim().isEmpty() || timeZoneStr.trim().toLowerCase().equals("local")) { return ZoneId.systemDefault(); try { return ZoneId.of(timeZoneStr); } catch (DateTimeException e1) { throw new RuntimeException("Invalid time zone displacement value"); ... |
String | slugifyDate(Long epochMillis) Turns the date into a format that has no spaces, colons, or any other invalid characters invalid for a file name The actual format used is: YYYY-MM-dd-HHmm-ssSS return slugifyDate(ZonedDateTime.ofInstant(Instant.ofEpochMilli(epochMillis), UTC));
|
ZoneId | verifyZoneId(String zoneId) Verifies if the given user zone id is handled by the server. if (zoneIds.contains(zoneId)) { return ZoneId.of(zoneId); return getDefaultZoneId(); |
ZoneId | zoneId(Object zoneId) zone Id if (zoneId == null) { return null; return zoneId(zoneId.toString()); |