parses duration strings