long s = (long) (unit.getModifiedSeconds(secondsPerDay, secondsPerWeek) * n.doubleValue());
try // detect if we just have a number time = Long.parseLong(durationStr.trim()) * defaultUnit.getModifiedSeconds(secondsPerDay, secondsPerWeek); } catch (Exception ex) // otherwise get the value