Ensure that DateTimeFormatter doesn't format an empty string

This fixes #4393 and maintains BC.
Merge pull request #4394 from akrabat/hotfix/4393

Ensure that DateTimeFormatter doesn't format an empty string
Merge branch 'hotfix/4394'

Close #4394
Fixes #4393