Java Utililty Methods Timestamp Convert To

List of utility methods to do Timestamp Convert To

Description

The list of methods to do Timestamp Convert To are organized into topic(s).

Method

InstanttoEPICSTime(java.sql.Timestamp timestamp)
Convert SQL time stamp into EPICS time stamp
return Instant.ofEpochSecond(timestamp.getTime() / 1000L, timestamp.getNanos());
StringtoFormatedString(final Timestamp ts, final String timeZoneId)
to Formated String
SimpleDateFormat df = new SimpleDateFormat(STANDARD_DATETIMEFORMAT);
df.setTimeZone(TimeZone.getTimeZone(timeZoneId));
return df.format(ts.getTime());
StringtoGmtTimestampString(Timestamp timestamp)
to Gmt Timestamp String
DateFormat df = DateFormat.getDateTimeInstance();
df.setTimeZone(TimeZone.getTimeZone("GMT"));
return df.format(timestamp);
InstanttoInstant(final Timestamp timestamp)
TODO: Documentation
return Instant.ofEpochMilli(timestamp.getTime());
DatetoJavaDate(Timestamp dt)
to Java Date
if (dt == null) {
    return null;
return new Date(dt.getTime());
LocalDateTimetoLocalDateTime(Timestamp timestamp)
to Local Date Time
if (timestamp == null) {
    return null;
return LocalDateTime.ofInstant(timestamp.toInstant(), ZoneOffset.systemDefault());
StringtoMediaWikiString(Timestamp timestamp)
to Media Wiki String
String original = timestamp.toString();
StringBuffer result = new StringBuffer();
result.append(original.substring(0, 4));
result.append(original.substring(5, 7));
result.append(original.substring(8, 10));
result.append(original.substring(11, 13));
result.append(original.substring(14, 16));
result.append(original.substring(17, 19));
...