The function actually did not enforce that the duration string starts with a P (or p), just that there is a P (or p) in the string.