List of utility methods to do Timestamp Now
String | getTimeStamp() Create logfile TimeStamp Timestamp ts = new Timestamp((new Date()).getTime()); String strTime = String.valueOf(ts.getTime()); if (strTime.length() > 10) { strTime = strTime.substring(0, 10); return strTime; |
String | getTimestamp() Get the TimeStamp like 2009-06-01T06:12:45Z return formatTimeStamp(new Timestamp(new Date().getTime())); |
Timestamp | getTimestamp() get Timestamp Date utilDate = new Date(); Timestamp sq = new Timestamp(utilDate.getTime()); System.out.println(sq); return sq; |
Timestamp | getTimeStamp() get Time Stamp String d = new SimpleDateFormat(TIME_FORMAT).format(Calendar.getInstance().getTime()); return Timestamp.valueOf(d); |
String | getTimestamp() Accessor method to return current time as a yyyy-MM-dd hh:mm:ss.SSS string (aka SQL TIMESTAMP format) long date = (new Date()).getTime(); return (new Timestamp(date)).toString(); |
Timestamp | getTimeStamp() get Time Stamp java.util.Date now = new java.util.Date(); return new java.sql.Timestamp(now.getTime()); |
Timestamp | getTimestamp() get Timestamp Timestamp ts = new Timestamp(getDate("yyyy-MM-dd HH:mm:ss").getTime()); return ts; |
Date | getTimestamp() get Timestamp return new java.sql.Timestamp(Calendar.getInstance().getTime().getTime()); |
boolean | isCurrentDataByStartdataAndEnddata(Timestamp startDate, Timestamp endDate) the method's result was used decsion isCurrentDate by startDate and endDate boolean result = false; Timestamp currentDate = getCurrentTimestamp(); if (endDate == null) { if (currentDate.compareTo(startDate) >= 0) { result = true; } else { if ((currentDate.compareTo(startDate)) >= 0 && (currentDate.compareTo(endDate)) <= 0) { ... |
Timestamp | nowTimestamp() now Timestamp Long now = System.nanoTime(); Timestamp value = new Timestamp(now / 1_000_000L); value.setNanos(Long.valueOf(now % 1_000_000_000L).intValue()); return value; |