List of utility methods to do Date to Timestamp Convert
Timestamp | Date2Timestamp(Date d) Date Timestamp return new Timestamp(d.getTime()); |
String | convertToTimeStamp(Date date) Convert date to short time string return convertToTimeStamp(date, true);
|
String | convertToTimeStamp(Date date, boolean showSeconds) Convert date to short time string Calendar c = Calendar.getInstance();
c.setTime(date);
return convertToTimeStamp(c, showSeconds);
|
long | unixTimestampFromDate(final Date date) unix Timestamp From Date final Calendar cal = Calendar.getInstance(); cal.setTime(date); return cal.getTimeInMillis() / 1000; |
String | getAccurateDate() get Accurate Date SimpleDateFormat fromat = new SimpleDateFormat("yyyyMMddHHmm"); Calendar c = Calendar.getInstance(); c.get(Calendar.YEAR); c.get(Calendar.MONTH + 1); c.get(Calendar.DAY_OF_MONTH); c.get(Calendar.HOUR_OF_DAY); c.get(Calendar.MINUTE); String time = fromat.format(c.getInstance().getTime()); ... |
String | getAccurateDate(Date date) get Accurate Date String result = AccurateTimeFormat.format(date);
return result;
|
String | toFullDate(Date date) to Full Date synchronized (DATE_FORMAT_FULL) { return DATE_FORMAT_FULL.format(date); |