Java Message Format formatDuring(long mss, String pattern)

Here you can find the source of formatDuring(long mss, String pattern)

Description

format During

License

Apache License

Declaration

public static String formatDuring(long mss, String pattern) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.text.MessageFormat;

public class Main {
    public static String formatDuring(long mss, String pattern) {
        long days = mss / (1000 * 60 * 60 * 24);
        long hours = (mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60);
        long minutes = (mss % (1000 * 60 * 60)) / (1000 * 60);
        long seconds = (mss % (1000 * 60)) / 1000;
        return MessageFormat.format(pattern, days, hours, minutes, seconds);
    }//from ww w .ja va2  s. co  m
}

Related

  1. format(String str, int replacement)
  2. format(String str, Object... arguments)
  3. format(String textPattern, Object... args)
  4. formatAsNumber(double value)
  5. formatCause(final String message, final Throwable cause, final Object... args)
  6. formatError(Map.Entry entry, String errorPlural, String errorSingular)
  7. formatMessage(final String pattern, final Object... params)
  8. formatMessage(final String pattern, final String param1)
  9. formatMessage(String message, Object param1)