List of utility methods to do Calendar to String
String | dateToString(Calendar date, DateFormat format) date To String if (date == null) return null; return format.format(date.getTime()); |
String | getDateString(Calendar cal) Returns the current date of the calendar in the m/d/yyyy format as a string return (cal.get(Calendar.MONTH) + 1) + "/" + cal.get(Calendar.DAY_OF_MONTH) + "/" + cal.get(Calendar.YEAR); |
String | getDateString(Calendar cal) get Date String int year = cal.get(Calendar.YEAR); int month = cal.get(Calendar.MONDAY) + 1; int day = cal.get(Calendar.DAY_OF_MONTH); return year + "-" + month + "-" + day; |
String | getDateString(Calendar calendar) get Date String StringBuffer sb = new StringBuffer(); sb.append(calendar.get(Calendar.YEAR)).append("-"); int month = calendar.get(Calendar.MONTH) + 1; if (month < 10) sb.append("0"); sb.append(month).append("-"); int day = calendar.get(Calendar.DAY_OF_MONTH); if (day < 10) ... |
String | getDateToString(Calendar argCal) Return YYYYMMDD Calendar cal = argCal; if (cal == null) { cal = new GregorianCalendar(); String date = "" + cal.get(Calendar.YEAR) + DATE_SEPARATOR; if (cal.get(Calendar.MONTH) + 1 < 10) { date += "0"; date += (cal.get(Calendar.MONTH) + 1) + DATE_SEPARATOR; if (cal.get(Calendar.DAY_OF_MONTH) < 10) { date += "0"; date += cal.get(Calendar.DAY_OF_MONTH); return date; |
String | getString(Calendar calendar) Return String object from Calendar @param calendar. return getString(PATTERN_DEFAULT, calendar);
|
String | toString(Calendar c) to String return getDateFormat().format(c.getTime());
|
String | toString(Calendar cal) Get a String representation of the Calendar with its date and time SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z"); return sdf.format(cal.getTime()); |
String | toString(Calendar cal) to String String timeZoneId = cal.getTimeZone().getID(); if (timeZoneId.equals("UTC")) { return utcFormat.format(cal.getTime()); } else if (timeZoneId.equals("TAI")) { return taiFormat.format(cal.getTime()) + "-0000" + (cal.getTimeZone().getRawOffset() / 1000); } else { return localFormat.format(cal.getTime()); |
String | toString(Calendar cal) Converts a Calendar to its CMISQL string representation. StringBuilder buf = new StringBuilder(28); toString(cal, buf); return buf.toString(); |