Parse a duration string