List of utility methods to do Time Format
String | getCurDateTime(String formatStr) get Cur Date Time SimpleDateFormat sdf = new SimpleDateFormat(formatStr); String now = sdf.format(new Date()); return now; |
String | getCurDateTimeFormat(String Format) get Cur Date Time Format Calendar now = Calendar.getInstance(TimeZone.getDefault()); DateFormat sdf = new SimpleDateFormat(Format); sdf.setTimeZone(TimeZone.getDefault()); return (sdf.format(now.getTime())); |
String | getCurrDatetimeWithDbFormat() get Curr Datetime With Db Format DateFormat dbDateFormat = dbDateFormatThreadLocal.get(); return dbDateFormat.format(new Date()); |
String | getCurTime(String dateformat) get Cur Time Calendar calendar = new GregorianCalendar(); Date date = calendar.getTime(); SimpleDateFormat format = new SimpleDateFormat(dateformat); return format.format(date); |
SimpleDateFormat | getDefaultDatetimeFormat() get Default Datetime Format return new SimpleDateFormat(DEFAULT_DATETIME_FORMAT_PATTERN); |
DateFormat | getDefaultPropertyPageDateTimeFormat() The default DateFormat to be used in property pages (used by implementations of IPropertySource ). return DateFormat.getDateTimeInstance(DateFormat.LONG, DateFormat.LONG);
|
String | getEndDate(String time, SimpleDateFormat dateFormat) get End Date Date nowDate = new Date(); Date timeDate = stringToDate(time, dateFormat); String endDate = ""; if (timeDate.after(nowDate)) { endDate = dateFormat.format(nowDate); } else { endDate = dateFormat.format(timeDate); return endDate; |
String | getFormat2TimetagStr() get Format Timetag Str return format2.format(new Date()); |
String | getFormatDate(Date date, boolean ShowTimePart_in) get Format Date if (ShowTimePart_in) { return (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(date); } else { return (new SimpleDateFormat("yyyy-MM-dd")).format(date); |
String | getFormatDate(String timeString, String format) get Format Date long timeLong = 0L; if (timeString == null || timeString.length() == 0) { timeLong = (new Date()).getTime(); } else { timeLong = Long.valueOf(timeString).longValue(); Date date = new Date(); date.setTime(timeLong); ... |