コード例 #1
0
 public String getCreateDateString() {
   if (createDateString == null || createDateString.trim().equals("")) {
     return RiceConstants.getDefaultDateFormat().format(getCreateDate());
   } else {
     return createDateString;
   }
 }
コード例 #2
0
ファイル: DumpDTO.java プロジェクト: colostate-is/rice
 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);
 }
コード例 #3
0
 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);
   }
 }