List of utility methods to do Timestamp Convert To
Instant | toEPICSTime(java.sql.Timestamp timestamp) Convert SQL time stamp into EPICS time stamp return Instant.ofEpochSecond(timestamp.getTime() / 1000L, timestamp.getNanos());
|
String | toFormatedString(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()); |
String | toGmtTimestampString(Timestamp timestamp) to Gmt Timestamp String DateFormat df = DateFormat.getDateTimeInstance(); df.setTimeZone(TimeZone.getTimeZone("GMT")); return df.format(timestamp); |
Instant | toInstant(final Timestamp timestamp) TODO: Documentation return Instant.ofEpochMilli(timestamp.getTime());
|
Date | toJavaDate(Timestamp dt) to Java Date if (dt == null) { return null; return new Date(dt.getTime()); |
LocalDateTime | toLocalDateTime(Timestamp timestamp) to Local Date Time if (timestamp == null) { return null; return LocalDateTime.ofInstant(timestamp.toInstant(), ZoneOffset.systemDefault()); |
String | toMediaWikiString(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));
...
|