List of utility methods to do Date Now
List | getDayToMonthEnd(boolean iscurrentdate) get Day To Month End List<String> list = new ArrayList<String>(); Calendar calendar = new GregorianCalendar(); int cday = calendar.get(Calendar.DAY_OF_MONTH); int currentyear = calendar.get(Calendar.YEAR); int currentmonth = calendar.get(Calendar.MONTH) + 1; if (iscurrentdate) { list.add(getYearAndMonthAndDay(currentyear, currentmonth, cday)); int maxDate = getMaxDayByYearMonth(getCustomerDay("yyyy-MM")); for (int i = cday + 1; i <= maxDate; i++) { list.add(getYearAndMonthAndDay(currentyear, currentmonth, i)); Collections.sort(list); return list; |
Date | getNowDate() get Now Date Date currentTime = new Date(); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); String dateString = formatter.format(currentTime); ParsePosition pos = new ParsePosition(8); Date currentTime_2 = formatter.parse(dateString, pos); return currentTime_2; |
String | getNowDate() return current date value in format: yyyy-MM-dd return dateToStringWithPattern(new Date(), "yyyy-MM-dd"); |
String | getNowDate() get Now Date return getFormatNowDateTime("yyyy-MM-dd"); |
String | getNowDate() get Now Date Date nowDate = new Date(); Calendar now = Calendar.getInstance(); now.setTime(nowDate); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); String str = formatter.format(now.getTime()); return str; |
Date | getNowDate() get Now Date date = new Date(); SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); String dateString = simpleDateFormat.format(date); return date; |
String | getNowDate() get Now Date Date date = new Date(); int nowMonth = date.getMonth() + 1; int nowYear = date.getYear() + 1900; int day = date.getDate(); String startTime = nowYear + "-" + nowMonth + "-" + day; return startTime; |
String | getNowDate() Gets the now date. GregorianCalendar gcNow = new GregorianCalendar(); java.util.Date dNow = gcNow.getTime(); DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.SIMPLIFIED_CHINESE); return df.format(dNow); |
String | getNowDate() get Now Date GregorianCalendar gcNow = new GregorianCalendar(); Date dNow = gcNow.getTime(); DateFormat df = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.SIMPLIFIED_CHINESE); return df.format(dNow); |
String | getNowDate(String format) get Now Date if (format == null) { return null; SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.JAPAN); java.util.Date date = Calendar.getInstance().getTime(); if (date == null) { return null; return sdf.format(date); |