List of utility methods to do Date to Timestamp
int | compareDate(String timeStamp1, String timeStamp2) compare Date SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); try { Date d1 = sdf.parse(timeStamp1); Date d2 = sdf.parse(timeStamp2); if (d1.compareTo(d2) == 0) { return -1; return d1.compareTo(d2); ... |
Timestamp | dateToTimestamp(Date date) date To Timestamp return new Timestamp(date.getTime()); |
Timestamp | dateToTimestamp(Date date) Converts a java.util.Date to a java.sql.Timestamp. return date == null ? null : new Timestamp(date.getTime()); |
Timestamp | dateToTimestamp(Date date) useful for webservice because we can not use java.sql.date in wsdl if (date == null) return null; java.sql.Timestamp stamp = new Timestamp(date.getTime()); return stamp; |
Timestamp | dateToTimestamp(Date date) date To Timestamp String temp = CHN_DATE_TIME_EXTENDED_FORMAT.format(date);
return Timestamp.valueOf(temp);
|
Timestamp | dateToTimestamp(Date date) A Utility method to convert a Date instance to Timestamp instance. if (date == null) { date = new Date(); return new Timestamp(date.getTime()); |
Integer | DateToTimestamp(Date time) Date To Timestamp Timestamp ts = new Timestamp(time.getTime()); return (int) ((ts.getTime()) / 1000); |
java.sql.Timestamp | dateToTimestamp(java.util.Date d) Converts a date to a SQL timestamp if (d == null) { return null; java.sql.Timestamp ts; ts = new java.sql.Timestamp(d.getTime()); return ts; |
Timestamp | dateToTimeStamp(java.util.Date date) date To Time Stamp Calendar cal = dateToCalendar(date);
return calToTimeStamp(cal);
|
Timestamp | dateToTimestamp(java.util.Date date) Description: Change the java.util.date format to java.sql.Timestamp format return new Timestamp(date.getTime()); |