List of utility methods to do Today
Date | getStartOfToday() get Start Of Today Calendar today = Calendar.getInstance(); int year = today.get(Calendar.YEAR); int month = today.get(Calendar.MONTH); int day = today.get(Calendar.DAY_OF_MONTH); return new GregorianCalendar(year, month, day, 0, 0, 0).getTime(); |
long | getStartOfToday() get Start Of Today Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("America/Los_Angeles")); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); return cal.getTime().getTime(); |
String | getStringToday() get String Today return getIntDate(getNow()) + ""; |
long | getTimeNumberToday() get Time Number Today Date date = new Date(); String str = yyyyMMdd.format(date); try { date = yyyyMMdd.parse(str); return date.getTime() / 1000L; } catch (ParseException e) { e.printStackTrace(); return 0L; |
Date | getToday() Returns the date representing today (by system time) without time Calendar c = Calendar.getInstance();
setZeroTime(c);
return c.getTime();
|
String | getToday() get Today Calendar cl = Calendar.getInstance(); String month = ""; String day = ""; String today = ""; String today2 = ""; int m = cl.get(Calendar.MONTH) + 1; if (m < 10) { month = "0" + String.valueOf(m); ... |
Date | getToday() get Today Calendar c = Calendar.getInstance();
c.setTimeZone(timeZone);
c.set(c.get(Calendar.YEAR), c.get(Calendar.MONTH), c.get(Calendar.DAY_OF_MONTH), 0, 0, 0);
return c.getTime();
|
int[] | getToday() Return today's year, month(1-12), day(1-31), week(0-6, for SUN, MON, ... return getDate(Calendar.getInstance());
|
Date | getToday() Get today's date as per local calendar. Date date = new Date(); Calendar cal = Calendar.getInstance(); cal.setTime(date); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTime(); ... |
String | getToday() get Today return getDateStr(new java.util.Date()); |