List of utility methods to do Timestamp Convert To
BigInteger | TimestampToBigint(String timestamp) Convert a string timestamp value to big integer. BigInteger result = BigInteger.valueOf(new Long(Timestamp.valueOf(timestamp).getTime())); return result; |
byte[] | timeStampToBytes(Timestamp ts) time Stamp To Bytes Calendar cal = Calendar.getInstance(); cal.setTime(ts); byte[] b = new byte[12]; b[0] = (byte) 0; b[1] = (byte) (cal.get(Calendar.YEAR) & 0xff); b[2] = (byte) (cal.get(Calendar.YEAR) >>> 8); b[3] = (byte) (cal.get(Calendar.MONTH) & 0xff); b[4] = (byte) (cal.get(Calendar.DATE) & 0xff); ... |
java.util.Calendar | timestampToCalendar(java.sql.Timestamp inTime) Returns Calendar converted from Timestamp. if (inTime == null) { return (null); java.util.Calendar cal = java.util.Calendar.getInstance(); cal.setTime(inTime); return (cal); |
Calendar | timestampToCalendar(Timestamp time) Converts Timestamps to Calendars. Calendar cal = new GregorianCalendar(); cal.setTime(time); return cal; |
Date | TimestampToDate(Integer time) Timestamp To Date long temp = (long) time * 1000; Timestamp ts = new Timestamp(temp); Date date = new Date(); try { date = ts; } catch (Exception e) { e.printStackTrace(); return date; |
java.util.Date | timestampToDate(java.sql.Timestamp ts) Convers a SQL timestamp to a Date if (ts == null) { return null; Date d = new Date(ts.getTime()); return d; |
Date | timeStampToDate(Timestamp tim) time Stamp To Date return timeStampToCal(tim).getTime();
|
Date | timestampToDate(Timestamp tt) timestamp To Date return new Date(tt.getTime()); |
String | TimestampToDateStr(Timestamp tmp) Timestamp To Date Str return SHORT_DATE_FORMAT.format(tmp);
|
String | timestampToDateString(Timestamp ts) timestamp To Date String String tsStr = ""; DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); tsStr = sdf.format(ts); return tsStr; |