Exemple #1
1
 private String getDate(String timeStampStr, String format) {
   DateFormat formatter = new SimpleDateFormat(format);
   long timeStamp = Long.parseLong(timeStampStr);
   Calendar calendar = Calendar.getInstance();
   calendar.setTimeInMillis(timeStamp);
   return formatter.format(calendar.getTime());
 }
  public boolean renewRole(SorRole role) {
    final Calendar cal = Calendar.getInstance();

    // TODO need to read configuration data for setting the default renewal date for this role type.
    // hard code to 6 months for now.
    cal.add(Calendar.MONTH, 6);
    role.setEnd(cal.getTime());
    return true;
  }