List of utility methods to do Today
double | today() today java.util.Calendar dte = java.util.Calendar.getInstance(); dte.setTime(new java.util.Date()); return date(dte.get(java.util.Calendar.YEAR), dte.get(java.util.Calendar.MONTH) + 1, dte.get(java.util.Calendar.DATE)); |
String | today() today return today(YYYYMMDD);
|
String | today() today return formatDate(new Date(), "yyyy-MM-dd"); |
String | today() today return dateToString(now(), DF_YMD);
|
Date | today() today try { return new SimpleDateFormat(DATE_FORMAT).parse(formatDate(new Date())); } catch (ParseException e) { e.printStackTrace(); return null; |
String | today() today return datetimeToStr(new Date()).substring(0, 8); |
Date | toDay(final String dateString) Tries to interpret a given string as a day This routines assumes that all date parts of a day are present, time components are ignored. if (dateString == null || dateString.trim().length() < 6) return null; Locale[] locales = { Locale.getDefault(), Locale.UK, Locale.GERMANY }; for (Locale locale : locales) { if (!DAY_PATTERNS.containsKey(locale)) { List<SimpleDateFormat> patterns = new ArrayList<SimpleDateFormat>(); for (String pattern : DAY_FORMATS) { patterns.add(new SimpleDateFormat(pattern, locale)); ... |
String | today(String format) today Date date = Calendar.getInstance().getTime(); return new SimpleDateFormat(format).format(date); |
String | today(String pattern) today Calendar calendar = Calendar.getInstance(); SimpleDateFormat dateFormat = new SimpleDateFormat(pattern); return dateFormat.format(calendar.getTime()); |
String | today(String strFormat) today return toString(new Date(), strFormat); |