Java Utililty Methods Today

List of utility methods to do Today

Description

The list of methods to do Today are organized into topic(s).

Method

DategetStartOfToday()
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();
longgetStartOfToday()
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();
StringgetStringToday()
get String Today
return getIntDate(getNow()) + "";
longgetTimeNumberToday()
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;
DategetToday()
Returns the date representing today (by system time) without time
Calendar c = Calendar.getInstance();
setZeroTime(c);
return c.getTime();
StringgetToday()
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);
...
DategetToday()
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());
DategetToday()
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();
...
StringgetToday()
get Today
return getDateStr(new java.util.Date());