info.jonclark.util
Class FormatUtils

java.lang.Object
  extended by info.jonclark.util.FormatUtils

public class FormatUtils
extends Object

Author:
Jonathan

Constructor Summary
FormatUtils()
           
 
Method Summary
static String formatFullDate(Date d)
          Format date like as in this example: Wednesday, March 31, 2005 5:23:55 pm
static String formatLongDate(Date d)
          Format date like as in this example: March 31, 2005
static String formatTimeSpan(long span, int nUnits)
          Format a timespan as in this examples: 5 days, 2 hours 9 minutes, 23 seconds BUT NOT 5 days, 2 hours, 9 minutes, 23 seconds
static String formatTimeSpanFull(long span)
          Format a timespan as in this example: 5 days, 2 hours, 9 minutes, 23 seconds
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatUtils

public FormatUtils()
Method Detail

formatFullDate

public static String formatFullDate(Date d)
Format date like as in this example: Wednesday, March 31, 2005 5:23:55 pm

Parameters:
d - The date object to be formatted
Returns:
The specified date formatted in the format shown above

formatLongDate

public static String formatLongDate(Date d)
Format date like as in this example: March 31, 2005

Parameters:
d - The date object to be formatted
Returns:
The specified date formatted in the format shown above

formatTimeSpanFull

public static String formatTimeSpanFull(long span)
Format a timespan as in this example: 5 days, 2 hours, 9 minutes, 23 seconds

Parameters:
span -
Returns:

formatTimeSpan

public static String formatTimeSpan(long span,
                                    int nUnits)
Format a timespan as in this examples: 5 days, 2 hours 9 minutes, 23 seconds BUT NOT 5 days, 2 hours, 9 minutes, 23 seconds

Parameters:
span -
nUnits - The maxiumum number of units that will be shown
Returns: