@Override public String toString() { return zonedDateTime.format(TimestampTZUtil.FORMATTER); }
/** * format unix time to string * * @param unixTime unix time * @param pattern date format pattern * @return return string date */ public static String toString(long unixTime, String pattern) { return Instant.ofEpochSecond(unixTime).atZone(ZoneId.systemDefault()).format(DateTimeFormatter.ofPattern(pattern)); }
/** * format unix time to string * * @param unixTime unix time * @param pattern date format pattern * @return return string date */ public static String toString(long unixTime, String pattern) { return Instant.ofEpochSecond(unixTime).atZone(ZoneId.systemDefault()).format(DateTimeFormatter.ofPattern(pattern)); }
@JsonValue @Override public String toString() { return Instant.ofEpochMilli(millisUtc).atZone(ZoneId.of(timeZoneKey.getId())).format(formatter); } }
@JsonValue @Override public String toString() { return Instant.ofEpochMilli(millisUtc).atZone(ZoneId.of(timeZoneKey.getId())).format(formatter); } }
@Override public String prettyPrint() { return assertPrintable( () -> value.format( DateTimeFormatter.ISO_DATE_TIME ) ); }
@Override public String toString() { return this.getClass().getSimpleName() + '{' + createdAt().format(DateTimeFormatter.ISO_DATE_TIME) + '}'; } }
public static ParameterizedType makeClassName(String baseName, Optional<String> suffix) { String className = baseName + "_" + suffix.orElseGet(() -> Instant.now().atZone(UTC).format(TIMESTAMP_FORMAT)) + "_" + CLASS_ID.incrementAndGet(); return typeFromJavaClassName("com.facebook.presto.$gen." + toJavaIdentifierString(className)); }
@JsonValue @Override public String toString() { return Instant.ofEpochMilli(millisUtc).atZone(ZoneId.of(timeZoneKey.getId())).format(formatter); } }
@JsonValue @Override public String toString() { return Instant.ofEpochMilli(millisUtc).atZone(ZoneId.of(timeZoneKey.getId())).format(formatter); } }
private static String getWalletFileName(WalletFile walletFile) { DateTimeFormatter format = DateTimeFormatter.ofPattern( "'UTC--'yyyy-MM-dd'T'HH-mm-ss.nVV'--'"); ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC); return now.format(format) + walletFile.getAddress() + ".json"; }
/** * Adds the date header for the given {@link ZonedDateTime}. * * @param date The local date time (will be converted to GMT) as per {@link DateTimeFormatter#RFC_1123_DATE_TIME} * @return The {@link MutableHttpHeaders} */ default MutableHttpHeaders date(LocalDateTime date) { if (date != null) { add(DATE, ZonedDateTime.of(date, ZoneId.of("GMT")).format(DateTimeFormatter.RFC_1123_DATE_TIME)); } return this; }
/** * Adds the LAST_MODIFIED header for the given {@link ZonedDateTime}. * * @param date The local date time (will be converted to GMT) as per {@link DateTimeFormatter#RFC_1123_DATE_TIME} * @return The {@link MutableHttpHeaders} */ default MutableHttpHeaders lastModified(LocalDateTime date) { if (date != null) { add(LAST_MODIFIED, ZonedDateTime.of(date, ZoneId.of("GMT")).format(DateTimeFormatter.RFC_1123_DATE_TIME)); } return this; }
/** * Adds the DATE header for the given {@link ZonedDateTime}. * * @param timeInMillis The current time in milli seconds * @return The {@link MutableHttpHeaders} */ default MutableHttpHeaders date(long timeInMillis) { ZonedDateTime date = ZonedDateTime.ofInstant(Instant.ofEpochMilli(timeInMillis), ZoneId.of("GMT")); add(DATE, date.format(DateTimeFormatter.RFC_1123_DATE_TIME)); return this; }
/** * Adds the LAST_MODIFIED header for the given {@link ZonedDateTime}. * * @param timeInMillis The current time in milli seconds * @return The {@link MutableHttpHeaders} */ default MutableHttpHeaders lastModified(long timeInMillis) { ZonedDateTime date = ZonedDateTime.ofInstant(Instant.ofEpochMilli(timeInMillis), ZoneId.of("GMT")); add(LAST_MODIFIED, date.format(DateTimeFormatter.RFC_1123_DATE_TIME)); return this; }
/** * Adds the EXPIRES header for the given {@link ZonedDateTime}. * * @param date The local date time (will be converted to GMT) as per {@link DateTimeFormatter#RFC_1123_DATE_TIME} * @return The {@link MutableHttpHeaders} */ default MutableHttpHeaders expires(LocalDateTime date) { if (date != null) { add(EXPIRES, ZonedDateTime.of(date, ZoneId.of("GMT")).format(DateTimeFormatter.RFC_1123_DATE_TIME)); } return this; }