org.linkedin.util-core/src/main/java/org/linkedin/util/clock/ClockUtils.java
public static Timespan toTimespan(Object t)
  {
    if(t == null)
      return null;

    if(t instanceof Timespan)
    {
      return (Timespan) t;
    }

    return Timespan.parse(t.toString());
  }
public static Timespan toTimespan(Object t)
  {
    if(t == null)
      return null;

    if(t instanceof Timespan)
    {
      return (Timespan) t;
    }

    return Timespan.parse(t.toString());
  }
public static Timespan toTimespan ( Object t ) { if ( t == null ) return null ; if ( t instanceof Timespan ) { return ( Timespan ) t ; } return Timespan . parse ( t . toString ( ) ) ; }
Converts the object into a timespan. If already a timespan then simply return the object.
Otherwise call {@link Timespan#parse(String)} on <code>t.toString()</code>. Works well for
long and <code>String</code>

@return a timespan (<code>null</code> if t is <code>null</code>)
Converts the object into a timespan . If already a timespan then simply return the object . Otherwise call { @link Timespan#parse ( String ) } on <code > t . toString () < / code > . Works well for long and <code > String< / code >