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

StringgetTodayDateInString()
returns today's date in DDMMYY format in string
String todaydate = new SimpleDateFormat("ddMMyy").format(new Date());
return todaydate;
StringgetTodayDbFormat()
get Today Db Format
return dbSdf.format(getToday());
StringgetTodayDisplayString()
get Today Display String
Calendar c = Calendar.getInstance();
StringBuffer sb = new StringBuffer();
sb.append(c.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault()));
sb.append(", ");
sb.append(get4CharDate(c.getTime()));
return sb.toString();
CalendargetTodayEnd()
get Today End
Calendar todayEnd = Calendar.getInstance();
todayEnd.set(Calendar.HOUR_OF_DAY, 23);
todayEnd.set(Calendar.MINUTE, 59);
todayEnd.set(Calendar.SECOND, 59);
return todayEnd;
StringgetTodayEnd()
get Today End
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
Date date = new Date(calendar.getTimeInMillis());
return longDateFormat.format(date);
StringgetToDayEndTime()
get To Day End Time
return getCurrentDay("yyyy-MM-dd") + " 23:59:59";
StringgetTodayFolder()
get Today Folder
return dateFormat.format(new Date());
StringgetTodayFormat(String format)
get Today Format
Date today = new Date(); 
SimpleDateFormat formater; 
formater = new SimpleDateFormat(format);
Calendar cal = Calendar.getInstance();
cal.setTime(today);
return formater.format(cal.getTime());
StringgetTodayFormatString(String pattern)
get Today Format String
SimpleDateFormat formatter = new SimpleDateFormat(pattern, Locale.UK);
return formatter.format(new Date());
StringgetTodayFormatted(String pattern)
Returns the date formatted in given pattern
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
return sdf.format(new Date());