public String getCreateDateString() { if (createDateString == null || createDateString.trim().equals("")) { return RiceConstants.getDefaultDateFormat().format(getCreateDate()); } else { return createDateString; } }
public String getFormattedCreateDate() { long time = getDocCreationDate().getTime(); Calendar calendar = Calendar.getInstance(); calendar.setTimeInMillis(time); Date date = calendar.getTime(); DateFormat dateFormat = RiceConstants.getDefaultDateFormat(); return dateFormat.format(date); }
public Timestamp formatDate(String dateLabel, String dateString) throws XmlException { if (StringUtils.isBlank(dateString)) { return null; } try { return new Timestamp(RiceConstants.getDefaultDateFormat().parse(dateString).getTime()); } catch (ParseException e) { throw new XmlException( dateLabel + " is not in the proper format. Should have been: " + RiceConstants.DEFAULT_DATE_FORMAT_PATTERN); } }