List of utility methods to do Today Get
Date | getToday() get Today Date now = new Date(); Date today = new Date(now.getYear(), now.getMonth(), now.getDate()); return today; |
String | getToday00Time() get Today Time Date curDate = new Date(System.currentTimeMillis()); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd000000"); String result = sdf.format(curDate); return result; |
String | getCurDateTimeinString() get Cur Date Timein String DateFormat df = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); Date today = Calendar.getInstance().getTime(); String reportDate = df.format(today); return reportDate; |
Date | today() today return new Date(now()); |
boolean | isToday(String sdate) is Today boolean b = false; Date time = toDate(sdate); Date today = new Date(); if (time != null) { String nowDate = dateFormater2.get().format(today); String timeDate = dateFormater2.get().format(time); if (nowDate.equals(timeDate)) { b = true; ... |
String | getTodaysDate() get Todays Date DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy", Locale.US); Date date = new Date(); String today = dateFormat.format(date); return today; |
boolean | isToday(long dateUtc) is Today final long currentTime = System.currentTimeMillis(); final Calendar calendarBefore = Calendar.getInstance(); calendarBefore.setTimeInMillis(currentTime); calendarBefore.set(Calendar.HOUR_OF_DAY, 0); calendarBefore.set(Calendar.MINUTE, 0); calendarBefore.set(Calendar.SECOND, 0); calendarBefore.set(Calendar.MILLISECOND, 0); final Calendar calendarAfter = Calendar.getInstance(); ... |