Package com.logicaldoc.util.time
Class TimeDiff
java.lang.Object
com.logicaldoc.util.time.TimeDiff
- 
Nested Class SummaryNested Classes
- 
Method SummaryModifier and TypeMethodDescriptionstatic long[]getTimeDifference(long t1, long t2) Calculate the absolute difference between two dates without regard for time offsetsstatic long[]getTimeDifference(Date d1, Date d2) Calculate the absolute difference between two Date without regard for time offsetsstatic longgetTimeDifference(Date d1, Date d2, TimeDiff.TimeField field) Calculate the absolute difference between two Date without regard for time offsetsstatic StringprintDuration(long diffMillis) Prints the duration in the format HH:MM:ss.SSSstatic StringprintDuration(Duration duration) Prints the duration in the format HH:MM:ss.SSSstatic StringprintDuration(Date start, Date end) 
- 
Method Details- 
getTimeDifferenceCalculate the absolute difference between two Date without regard for time offsets- Parameters:
- d1- Date one
- d2- Date two
- field- The field we're interested in: day, hour, minute, second, millisecond
- Returns:
- The value of the required field
 
- 
getTimeDifferencepublic static long[] getTimeDifference(long t1, long t2) Calculate the absolute difference between two dates without regard for time offsets- Parameters:
- t1- Date one expressed in milliseconds
- t2- Date two expressed in milliseconds
- Returns:
- The fields day, hour, minute, second and millisecond
 
- 
getTimeDifferenceCalculate the absolute difference between two Date without regard for time offsets- Parameters:
- d1- Date one
- d2- Date two
- Returns:
- The fields day, hour, minute, second and millisecond
 
- 
printDuration
- 
printDurationPrints the duration in the format HH:MM:ss.SSS- Parameters:
- diffMillis- Duration expressed in milliseconds
- Returns:
- The formatted output
 
- 
printDurationPrints the duration in the format HH:MM:ss.SSS- Parameters:
- duration- the Duration to printed in human readable format
- Returns:
- The formatted output
 
 
-