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

StringgetToday(String datePattern)
get Today
Format formatter = new SimpleDateFormat(datePattern);
return formatter.format(Today());
StringgetToday(String format)
get Today
String result = "";
try {
    Date today = new Date();
    SimpleDateFormat simpleFormat = new SimpleDateFormat(format);
    result = simpleFormat.format(today);
} catch (Exception e) {
return result;
...
StringgetToday(String formatString)
get Today
Date today = new Date();
Locale currentLocale = new Locale("KOREAN", "KOREA");
String pattern = formatString;
SimpleDateFormat formatter = new SimpleDateFormat(pattern, currentLocale);
return formatter.format(today);
DategetToday(String time)
get Today
String today = todayStr();
return getDateTime(today + " " + time, DEFAULT_FORMAT_DATETIME);
longgetTodayAsLong()
Liefert das heutige Datum als long
long ret = 0;
GregorianCalendar calToday = new GregorianCalendar(TimeZone.getTimeZone("Europe/Berlin"));
calToday.setFirstDayOfWeek(Calendar.SUNDAY);
try {
    ret = getDateAsLong(calToday.getTime());
} catch (NumberFormatException e) {
return ret;
...
StringgetTodayAsSecond()
get Today As Second
return getTodayAsSecond(0);
DategetTodayDate()
get Today Date
return parseDateFromDateStr(formatDate2DateStr(new Date()));
DategetTodayDate()
get Today Date
DateFormat dateFormat = new SimpleDateFormat(ENCOUNTER_DATE_PATTERN);
Date date = new Date();
String dateString = dateFormat.format(date);
return getDateFromString(dateString);
DategetTodayDate()
get Today Date
Calendar cal = Calendar.getInstance();
Calendar now = Calendar.getInstance();
now.clear();
now.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH), cal.get(Calendar.DATE));
return now.getTime();
StringgetTodayDateAsString()
get the current date as string using the mysql date format yyyy-MM-dd
Calendar calendar = Calendar.getInstance();
Date today = calendar.getTime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(mysqlDateFormat);
return simpleDateFormat.format(today);