Ejemplo n.º 1
0
 /**
  * @param startTime Start time or null.
  * @param stopTime Stop time or null.
  */
 public static String getUTCDates(final Date startTime, final Date stopTime) {
   final StringBuffer buf = new StringBuffer();
   final DateHolder start = startTime != null ? new DateHolder(startTime) : null;
   final DateHolder stop = stopTime != null ? new DateHolder(stopTime) : null;
   if (start != null) {
     buf.append(DateHelper.TECHNICAL_ISO_UTC.get().format(start.getDate()));
     if (stop != null) {
       buf.append(" - ");
     }
   }
   if (stop != null) {
     buf.append(DateHelper.TECHNICAL_ISO_UTC.get().format(stop.getDate()));
   }
   return buf.toString();
 }
Ejemplo n.º 2
0
 /**
  * @param label Label as prefix
  * @param date
  * @return <label>: <date>
  */
 public static String getUTCDate(final String label, final Date date) {
   if (date == null) {
     return label + ":";
   }
   final DateHolder dh = new DateHolder(date);
   return label + ": " + DateHelper.TECHNICAL_ISO_UTC.get().format(dh.getDate());
 }