Java SQL Date Format formatDurationMillisToString(long millis)

Here you can find the source of formatDurationMillisToString(long millis)

Description

format Duration Millis To String

License

Open Source License

Declaration

public static String formatDurationMillisToString(long millis) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.sql.Date;
import java.text.SimpleDateFormat;

public class Main {
    public static final String DURATION_PATTERN = "HH:mm:ss.SSS";
    private static final SimpleDateFormat FORMAT = new SimpleDateFormat(DURATION_PATTERN);

    public static String formatDurationMillisToString(long millis) {
        return formatMillisToString(millis, DURATION_PATTERN);
    }/*w ww  .j a v  a  2 s .  c  o m*/

    public static String formatMillisToString(long millis, String pattern) {
        Date date = new Date(millis);
        FORMAT.applyPattern(pattern);
        return FORMAT.format(date);
    }
}

Related

  1. formatDate(java.util.Date uDate)
  2. formatDate(Object obj)
  3. formatDate(String date)
  4. formatDateTd(Object obj)
  5. formatDateToCustfmt(java.util.Date date, String dateFmt)
  6. formatFloat(int floatValue)
  7. formatLogParam(Array obj)
  8. formatNumberWithZeroPrefix(int numOfZero, Integer value)
  9. formatSQLError(SQLException e)