public static final String writeTime(final double seconds,final String timeformat,final char separator){
  if (TIMEFORMAT_SSSS.equals(timeformat)) {
    return Long.toString((long)seconds);
  }
  if (seconds < 0) {
    if (seconds == UNDEFINED_TIME)     return "undefined";
    return "-" + writeTime(Math.abs(seconds),timeformat,separator);
  }
  double s=seconds;
  long h=(long)(s / 3600);
  s=s % 3600;
  int m=(int)(s / 60);
  s=s % 60;
  StringBuilder str=new StringBuilder(10);
  if (h < timeElements.length) {
    str.append(timeElements[(int)h]);
  }
 else {
    str.append(Long.toString(h));
  }
  str.append(separator);
  str.append(timeElements[m]);
  if (TIMEFORMAT_HHMM.equals(timeformat)) {
    return str.toString();
  }
  if (TIMEFORMAT_HHMMSS.equals(timeformat)) {
    str.append(separator);
    str.append(timeElements[(int)s]);
    return str.toString();
  }
  if (TIMEFORMAT_HHMMSSDOTSS.equals(timeformat)) {
    str.append(separator);
    if (s < 10.) {
      str.append("0");
    }
    str.append(s);
    return str.toString();
  }
  throw new IllegalArgumentException("The time format (" + timeformat + ") is not known.");
}

public static final String writeTime ( final double seconds , final String timeformat , final char separator ) { if ( TIMEFORMAT_SSSS . equals ( timeformat ) ) { return Long . toString ( ( long ) seconds ) ; } if ( seconds < 0 ) { if ( seconds == UNDEFINED_TIME ) return "undefined" ; return "-" + writeTime ( Math . abs ( seconds ) , timeformat , separator ) ; } double s = seconds ; long h = ( long ) ( s / 3600 ) ; s = s % 3600 ; int m = ( int ) ( s / 60 ) ; s = s % 60 ; StringBuilder str = new StringBuilder ( 10 ) ; if ( h < timeElements . length ) { str . append ( timeElements [ ( int ) h ] ) ; } else { str . append ( Long . toString ( h ) ) ; } str . append ( separator ) ; str . append ( timeElements [ m ] ) ; if ( TIMEFORMAT_HHMM . equals ( timeformat ) ) { return str . toString ( ) ; } if ( TIMEFORMAT_HHMMSS . equals ( timeformat ) ) { str . append ( separator ) ; str . append ( timeElements [ ( int ) s ] ) ; return str . toString ( ) ; } if ( TIMEFORMAT_HHMMSSDOTSS . equals ( timeformat ) ) { str . append ( separator ) ; if ( s < 10. ) { str . append ( "0" ) ; } str . append ( s ) ; return str . toString ( ) ; } throw new IllegalArgumentException ( "The time format (" + timeformat + ") is not known." ) ; }
converts the given time in seconds after midnight into a textual representation
