Bug 8532 - improve robustness when converting dates