Java Utililty Methods Instant to String

List of utility methods to do Instant to String

Description

The list of methods to do Instant to String are organized into topic(s).

Method

StringtimestampToDecimalString(Instant t)
Converts the timestamp to seconds as a floating point (seconds.nano).
return t.getEpochSecond() + "." + NANO_FORMATTER.get().format(t.getNano());
StringtimestampToLittleEndianString(Instant t, boolean includeYear)
Transforms the timestamp to string, using the format HH:mm:ss.SSS MMM dd (yyyy).
if (t == null) {
    return null;
return includeYear ? SLE_TIMESTAMP_FORMATTER.get().format(Date.from(t))
        : LE_TIMESTAMP_FORMATTER.get().format(Date.from(t));