String was not recognized as a valid DateTime - Why this error is coming suddenly?

When working format array, the method signature is to meet

e.g.

taken from: FirstAid