Convert duration string to ms.