Add a type test for the signature_date_format

Sometimes the value of the lambda is 'str' instead of datetime and make the strftime fail.
So I test the type before performing the operation.