List of utility methods to do Date to String
String | convertDate2String8(Date time) yyyyMMddHH return sdf8.format(time);
|
String | convertDateTimeToString(Date date) convert Date Time To String SimpleDateFormat dateFormat = new SimpleDateFormat("dd-MM-yyyy"); try { return dateFormat.format(date); } catch (Exception e) { throw e; |
String | convertDateTo(Date date, String patternToUse) Convert the given date in the given format. if (date == null) { return null; SimpleDateFormat formatter = new SimpleDateFormat(); formatter.setLenient(false); formatter.applyPattern(patternToUse); return formatter.format(date); |
String | convertDateToServerTimeZoneDate(DateFormat formatter, String timeZoneName, long milliSecond) This will convert server date/time to specified Time zone date/time and return the date in specified format. Long loginTimeZoneDate = milliSecond; if (timeZoneName != null) { loginTimeZoneDate = convertDateToServerTimeZoneDateInMilliSec(timeZoneName, milliSecond); return formatter.format(new Date(loginTimeZoneDate)); |
String | convertDateToStr(Date d, String format) convert Date To Str SimpleDateFormat simpledateformat = new SimpleDateFormat(format); String s; try { s = simpledateformat.format(d).toString(); return s; } catch (Exception e) { s = "1900-01-01"; return s; |
String | convertDateToStr(Date date, String format) Date convert to String ------------------------------ SimpleDateFormat f = new SimpleDateFormat(format, Locale.SIMPLIFIED_CHINESE); return f.format(date); |
String | convertDateToString(final Date datum, final boolean withDay) konvertiere ein Date in ein lesbareres format. final Calendar calendar = Calendar.getInstance(); calendar.setTime(datum); final SimpleDateFormat format = new SimpleDateFormat(DATE_TIME_FORMAT_PATTERN); if (withDay) { return calendar.getDisplayName(Calendar.DAY_OF_WEEK, Calendar.LONG, Locale.getDefault()) + " " + format.format(datum); } else { return format.format(datum); ... |
String | convertDateToString(java.util.Date dt, String pattern) Convertidor de fechas a un patron dado String formattedString = null; try { SimpleDateFormat formatter = new SimpleDateFormat(pattern); formattedString = formatter.format(dt); } catch (Exception e) { formattedString = "-"; return formattedString; ... |
String | convertDateToString(String dateFormat, Date date) convert Date To String SimpleDateFormat sf = new SimpleDateFormat(dateFormat); String dateStr = ""; if (date == null) { return dateStr; dateStr = sf.format(date); return dateStr; |
String | convertDateToString(String mask, Date date) This method generates a string representation of a date's date/time in the format you specify on input. SimpleDateFormat df = null; String returnValue = ""; if (date == null) { } else { df = new SimpleDateFormat(mask); returnValue = df.format(date); return returnValue; ... |