code: public static Duration getInstance(String dur, NumberFormat format, Locale locale) throws MPXJException
     {
        try
        {
           int lastIndex = dur.length() - 1;
           int index = lastIndex;
           double duration;
           TimeUnit units;
  
           while ((index > 0) && (Character.isDigit(dur.charAt(index)) == false))
           {
              --index;
           }
  
           //
           // If we have no units suffix, assume days to allow for MPX3
           //
           if (index == lastIndex)
           {
              duration = format.parse(dur).doubleValue();
              units = TimeUnit.DAYS;
           }
           else
           {
              ++index;
              duration = format.parse(dur.substring(0, index)).doubleValue();
              while ((index < lastIndex) && (Character.isWhitespace(dur.charAt(index))))
              {
                 ++index;
              }
              units = TimeUnitUtility.getInstance(dur.substring(index), locale);
           }
  
           return (Duration.getInstance(duration, units));
        }
  
        catch (ParseException ex)
        {
           throw new MPXJException("Failed to parse duration", ex);
        }
     }
docs: Retrieve an Duration instance. Use shared objects to
  represent common values for memory efficiency.
  
  @param dur duration formatted as a string
  @param format number format
  @param locale target locale
  @return Duration instance
  @throws MPXJException