fix date formatting when no encoding is set (eg. in tests)