static public String getLongFormattedDays ( long dt ) { StringBuffer ret = new StringBuffer ( ) ; long days = dt / 86400000L ; long millis = dt - ( days * 86400000L ) ; if ( days > 0 ) { ret . append ( Long . toString ( days ) ) ; ret . append ( " day" ) ; if ( days > 1 ) ret . append ( "s" ) ; } long hours = millis / 3600000L ; millis = millis - ( hours * 3600000L ) ; if ( hours > 0 ) { if ( ret . length ( ) > 0 ) ret . append ( " " ) ; ret . append ( Long . toString ( hours ) ) ; ret . append ( " hour" ) ; if ( hours > 1 ) ret . append ( "s" ) ; } long minutes = millis / 60000L ; millis = millis - ( minutes * 60000L ) ; if ( minutes > 0 ) { if ( ret . length ( ) > 0 ) ret . append ( " " ) ; ret . append ( Long . toString ( minutes ) ) ; ret . append ( " minute" ) ; if ( minutes > 1 ) ret . append ( "s" ) ; } long seconds = millis / 1000L ; if ( seconds > 0 ) { if ( ret . length ( ) > 0 ) ret . append ( " " ) ; ret . append ( Long . toString ( seconds ) ) ; ret . append ( " second" ) ; if ( seconds > 1 ) ret . append ( "s" ) ; } return ret . toString ( ) ; }
Returns the given time formatted as a number of days hours and minutes .