DateFormatUtils: formatUTC : DateFormatUtils « Apache Common « Java Tutorial






import java.util.Date;

import org.apache.commons.lang.time.DateFormatUtils;

public class MainClass {
    public static void main(String[] args) {

      //Format milliseconds in long using UTC timezone
      System.out.println("5) MM/dd/yy HH:mm >>>" +
          DateFormatUtils.formatUTC(System.currentTimeMillis(),
              "MM/dd/yy HH:mm"));


    }
}
5) MM/dd/yy HH:mm >>>05/09/07 19:54
  Download:  CommonLangDateFormatUtils.formatUTC.zip( 199 k)








37.8.DateFormatUtils
37.8.1.Date UTC Format
37.8.2.DateFormatUtils.Format: DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT
37.8.3.DateFormatUtils: ddMMyyyy
37.8.4.DateFormatUtils: SMTP_DATETIME_FORMAT
37.8.5.DateFormatUtils: ISO_DATE_FORMAT
37.8.6.DateFormatUtils: formatUTC
37.8.7.Using DateFormatUtils.format to format current time to format: MMM dd yy HH:mm
37.8.8.DateFormatUtils.ISO_DATETIME_TIME_ZONE_FORMAT