xmlBlaster 2.2.0 API

org.xmlBlaster.engine
Class IsoDateJoda

java.lang.Object
  extended by org.xmlBlaster.engine.IsoDateJoda

public class IsoDateJoda
extends java.lang.Object

Some Joda time utitility methods, depends on lib/joda-time.jar http://www.w3.org/TR/1998/NOTE-datetime-19980827


Constructor Summary
IsoDateJoda()
           
 
Method Summary
static java.lang.String getDifference(long diffMillis, boolean trimDateIfPossible)
          Calculate the difference of given millis.
static java.lang.String getDifferenceToNow(java.lang.String utc)
          Calculate the difference from the given time to now.
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IsoDateJoda

public IsoDateJoda()
Method Detail

getDifferenceToNow

public static java.lang.String getDifferenceToNow(java.lang.String utc)
Calculate the difference from the given time to now. ISO 8601 states: Durations are represented by the format P[n]Y[n]M[n]DT[n]H[n]M[n]S

Parameters:
utc - Given time, e.g. "1997-07-16T19:20:30.45+01:00"
Returns:
The ISO 8601 Period like "P3Y6M4DT12H30M17S"

getDifference

public static java.lang.String getDifference(long diffMillis,
                                             boolean trimDateIfPossible)
Calculate the difference of given millis.

Parameters:
diffMillis - The elapsed time
trimDateIfPossible - true:
 
 3000->00:00:03
 380000->00:06:20
 5692439078->1581:13:59.078
 
false:
 
   3000->P0000-00-00T00:00:03
   5692439078->P0000-00-00T1581:13:59.078
 
Returns:
The ISO 8601 Period like "P3Y6M4DT12H30M17S"

main

public static void main(java.lang.String[] args)

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.