This chunk of code is duplicated from PayloadRegexDecoder, maybe it should be separated out into a utility function, alongside ForgivingTimeParse?