private String formatYmdHis(Date date) {
    Calendar ca = Calendar.getInstance(CHINA_ZONE, CHINA_LOCALE);
    ca.setTimeInMillis(date.getTime());
    StringBuilder sbd = new StringBuilder();
    sbd.append(ca.get(Calendar.YEAR)).append('-');
    int month = 1 + ca.get(Calendar.MONTH);
    if (month < 10) {
      sbd.append('0');
    }
    sbd.append(month).append('-');
    int day = ca.get(Calendar.DAY_OF_MONTH);
    if (day < 10) {
      sbd.append('0');
    }
    sbd.append(day).append(' ');
    int hour = ca.get(Calendar.HOUR_OF_DAY);
    if (hour < 10) {
      sbd.append('0');
    }
    sbd.append(hour).append(':');
    int minute = ca.get(Calendar.MINUTE);
    if (minute < 10) {
      sbd.append('0');
    }
    sbd.append(minute).append(':');
    int second = ca.get(Calendar.SECOND);
    if (second < 10) {
      sbd.append('0');
    }
    sbd.append(second);
    return sbd.toString();
  }
private String formatYmdHis ( Date date ) { Calendar ca = Calendar . getInstance ( CHINA_ZONE , CHINA_LOCALE ) ; ca . setTimeInMillis ( date . getTime ( ) ) ; StringBuilder sbd = new StringBuilder ( ) ; sbd . append ( ca . get ( Calendar . YEAR ) ) . append ( '-' ) ; int month = 1 + ca . get ( Calendar . MONTH ) ; if ( month < 10 ) { sbd . append ( '0' ) ; } sbd . append ( month ) . append ( '-' ) ; int day = ca . get ( Calendar . DAY_OF_MONTH ) ; if ( day < 10 ) { sbd . append ( '0' ) ; } sbd . append ( day ) . append ( ' ' ) ; int hour = ca . get ( Calendar . HOUR_OF_DAY ) ; if ( hour < 10 ) { sbd . append ( '0' ) ; } sbd . append ( hour ) . append ( ':' ) ; int minute = ca . get ( Calendar . MINUTE ) ; if ( minute < 10 ) { sbd . append ( '0' ) ; } sbd . append ( minute ) . append ( ':' ) ; int second = ca . get ( Calendar . SECOND ) ; if ( second < 10 ) { sbd . append ( '0' ) ; } sbd . append ( second ) ; return sbd . toString ( ) ; }
构造时间的显示，带上时分秒的信息，如 2013-06-11 03:14:25

@param date 时间
@return 字符串表示