Avoid calling expensive methods before checking if we need to

There’s no need to create the full $record structure before checking for handlers. This can be called inside a loop, and Datetime::createFromFormat() is very expensive.
Well I think this is one case where we can afford to break BC in a minor way as to my knowledge it won't break anything. If anyone has a problem it's easy to fix by creating more of the record early anyway.