List of utility methods to do Calendar to Time
String | calendarToTimeString(Calendar calendar) calendar To Time String String time = Integer.toString(calendar.get(Calendar.HOUR_OF_DAY)); time += ":"; if (calendar.get(Calendar.MINUTE) < 10) { time += "0"; time += Integer.toString(calendar.get(Calendar.MINUTE)); return time; |
String | getCalendarStringTime(Calendar c) Get time from a Calendar DateFormat dfm = new SimpleDateFormat("HH:mm:ss"); return dfm.format(c.getTime()); |
String | getTime(Calendar c) get Time return getDate(c.getTime(), "HH:mm:ss"); |
String | getTime(Calendar calendar) get Time return getTime(calendar.getTime());
|
String | getTime(Calendar calendar) get Time return getTime(calendar.getTime());
|
String | getTime(Calendar pCalendar_) get Time SimpleDateFormat pSimpleDateFormat = new SimpleDateFormat("HH:mm:ss"); pSimpleDateFormat.setCalendar(pCalendar_); String sRetVal = pSimpleDateFormat.format(pCalendar_.getTime()); return sRetVal; |
String | getTimeString(Calendar cal) Returns the time given by cal as a String formatted as needed. SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); sdf.setTimeZone(TimeZone.getTimeZone("UTC")); return sdf.format(cal.getTime()).replace("+0000", "Z"); |
String | getTimeString(Calendar calendar) get Time String StringBuffer sb = new StringBuffer();
sb.append(String.valueOf(calendar.get(Calendar.YEAR)))
.append(valueOfString(String.valueOf(calendar.get(Calendar.MONTH) + 1), 2))
.append(valueOfString(String.valueOf(calendar.get(Calendar.DAY_OF_MONTH)), 2))
.append(valueOfString(String.valueOf(calendar.get(Calendar.HOUR_OF_DAY)), 2))
.append(valueOfString(String.valueOf(calendar.get(Calendar.MINUTE)), 2))
.append(valueOfString(String.valueOf(calendar.get(Calendar.SECOND)), 2))
.append(valueOfString(String.valueOf(calendar.get(Calendar.MILLISECOND)), 3));
...
|
String | printTime(Calendar value) print Time if (value == null) throw new IllegalArgumentException("Can't print time value!"); else return getTimeFormat().format(value.getTime()); |